Skip to content

Commit 008017b

Browse files
authored
Don't compile dynamic linking code into non-PIC version of libc. NFC (#18638)
Replaces #18637
1 parent 452ada3 commit 008017b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/library_dylink.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,18 @@ var LibraryDylink = {
240240
_emscripten_dlopen_js__deps: [function() { error(dlopenMissingError); }],
241241
_dlsym_js__deps: [function() { error(dlopenMissingError); }],
242242
_dlsym_catchup_js__deps: [function() { error(dlopenMissingError); }],
243+
dlopen__deps: [function() { error(dlopenMissingError); }],
244+
_emscripten_dlopen__deps: [function() { error(dlopenMissingError); }],
245+
__dlsym__deps: [function() { error(dlopenMissingError); }],
243246
#else
244247
$dlopenMissingError: `= ${dlopenMissingError}`,
245248
_dlopen_js__deps: ['$dlopenMissingError'],
246249
_emscripten_dlopen_js__deps: ['$dlopenMissingError'],
247250
_dlsym_js__deps: ['$dlopenMissingError'],
248251
_dlsym_catchup_js__deps: ['$dlopenMissingError'],
252+
dlopen__deps: ['$dlopenMissingError'],
253+
_emscripten_dlopen__deps: ['$dlopenMissingError'],
254+
__dlsym__deps: ['$dlopenMissingError'],
249255
#endif
250256
_dlopen_js: function(handle) {
251257
abort(dlopenMissingError);
@@ -259,6 +265,16 @@ var LibraryDylink = {
259265
_dlsym_catchup_js: function(handle, symbolIndex) {
260266
abort(dlopenMissingError);
261267
},
268+
dlopen: function(handle) {
269+
abort(dlopenMissingError);
270+
},
271+
_emscripten_dlopen: function(handle, onsuccess, onerror, user_data) {
272+
abort(dlopenMissingError);
273+
},
274+
__dlsym: function(handle, symbol) {
275+
abort(dlopenMissingError);
276+
},
277+
_dlinit: function(main_dso_handle) {},
262278
_dlinit: function(main_dso_handle) {},
263279
#else // MAIN_MODULE != 0
264280
// dynamic linker/loader (a-la ld.so on ELF systems)

tools/system_libs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,6 @@ def get_files(self):
11271127
libc_files += files_in_path(
11281128
path='system/lib/libc',
11291129
filenames=[
1130-
'dynlink.c',
11311130
'emscripten_console.c',
11321131
'emscripten_fiber.c',
11331132
'emscripten_get_heap_size.c',
@@ -1145,6 +1144,9 @@ def get_files(self):
11451144
'wasi-helpers.c',
11461145
])
11471146

1147+
if settings.RELOCATABLE:
1148+
libc_files += files_in_path(path='system/lib/libc', filenames=['dynlink.c'])
1149+
11481150
libc_files += files_in_path(
11491151
path='system/lib/pthread',
11501152
filenames=['emscripten_atomic.c', 'thread_profiler.c'])

0 commit comments

Comments
 (0)