diff --git a/ChangeLog.md b/ChangeLog.md index 5444389f301fd..83ee516b90682 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -23,6 +23,17 @@ See docs/process.md for more on how version tagging works. - Support for explicitly targeting the legacy Interet Explorer or EdgeHTML (edge version prior to the chromium-based edge) browsers via `-sMIN_EDGE_VERSION/-sMIN_IE_VERSION` was removed. (#20881) +- Emscripten is now more strict about handling unsupported shared library + inputs. For example, under the old behaviour if a system shared library + such as `/usr/lib/libz.so` was passed to emscripten it would silently re-write + this to `-lz`, which would then search this a libz in its own sysroot. Now + this file is passed though the linker like any other input file and you will + see an `unknown file type` error from the linker (just like you would with the + native clang or gcc toolchains). (#20886) +- Support for explicitly targeting the legacy EdgeHTML browser (edge version + prior to the chromium-based edge) via `-sMIN_EDGE_VERSION` was removed. + Using `-sLEGACY_VM_SUPPORT` should still work if anyone still wanted to target + this or any other legacy browser. - Breaking change: Using the `*glGetProcAddress()` family of functions now requires passing a linker flag -sGL_ENABLE_GET_PROC_ADDRESS. This prevents ports of native GL renderers from later accidentally attempting to activate diff --git a/emcc.py b/emcc.py index 4225a02690984..315158577077d 100644 --- a/emcc.py +++ b/emcc.py @@ -761,16 +761,7 @@ def phase_setup(options, state, newargs): else: message = arg + ': Unknown format, not a static library!' exit_with_error(message) - if file_suffix in DYNAMICLIB_ENDINGS and not building.is_bitcode(arg) and not building.is_wasm(arg): - # For shared libraries that are neither bitcode nor wasm, assuming its local native - # library and attempt to find a library by the same name in our own library path. - # TODO(sbc): Do we really need this feature? See test_other.py:test_local_link - libname = removeprefix(get_library_basename(arg), 'lib') - flag = '-l' + libname - diagnostics.warning('map-unrecognized-libraries', f'unrecognized file type: `{arg}`. Mapping to `{flag}` and hoping for the best') - state.add_link_flag(i, flag) - else: - input_files.append((i, arg)) + input_files.append((i, arg)) elif arg.startswith('-L'): state.add_link_flag(i, arg) newargs[i] = '' diff --git a/test/test_other.py b/test/test_other.py index d77e83b6024ee..66fea03785cb6 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -1642,33 +1642,6 @@ def test_abspaths(self): WARNING = 'encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript)' self.assertContainedIf(WARNING, proc.stderr, expected) - def test_local_link(self): - # Linking a local library directly, like /usr/lib/libsomething.so, cannot work of course since it - # doesn't contain bitcode. However, when we see that we should look for a bitcode file for that - # library in the -L paths and system/lib - create_file('main.c', ''' - extern void printey(); - int main() { - printey(); - return 0; - } - ''') - - ensure_dir('subdir') - create_file('subdir/libfile.so.1.2.3', 'this is not llvm bitcode!') - - create_file('libfile.c', ''' - #include - void printey() { - printf("hello from lib\\n"); - } - ''') - - self.run_process([EMCC, 'libfile.c', '-shared', '-o', 'libfile.so'], stderr=PIPE) - err = self.run_process([EMCC, 'main.c', Path('subdir/libfile.so.1.2.3'), '-L.'], stderr=PIPE).stderr - self.assertContained('Mapping to `-lfile` and hoping for the best [-Wmap-unrecognized-libraries]', err) - self.assertContained('hello from lib', self.run_js('a.out.js')) - def test_identical_basenames(self): # Issue 287: files in different dirs but with the same basename get confused as the same, # causing multiply defined symbol errors