Skip to content

Commit

Permalink
Treat .bc files as source files
Browse files Browse the repository at this point in the history
This matches the behaviour of clang, and means that `.ll` and `.bc`
files get treated similarly.  The modified test here no longer applies
since we no longer run `nm` on linker inputs.
  • Loading branch information
sbc100 committed Dec 14, 2023
1 parent e43f056 commit a8b0f0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ See docs/process.md for more on how version tagging works.
3.1.52 (in development)
-----------------------
- The `--default-obj-ext` command line flag was removed. (#20917)
- emcc will not treat files with the `.bc` extension as source files. These
will get compiled to object files before being passed to the linker. This
matches the behaviour of clang.

3.1.51 - 12/13/23
-----------------
Expand Down
2 changes: 1 addition & 1 deletion emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
SPECIAL_ENDINGLESS_FILENAMES = [os.devnull]
C_ENDINGS += SPECIAL_ENDINGLESS_FILENAMES # consider the special endingless filenames like /dev/null to be C

SOURCE_ENDINGS = C_ENDINGS + CXX_ENDINGS + OBJC_ENDINGS + OBJCXX_ENDINGS + ['.ll', '.S']
SOURCE_ENDINGS = C_ENDINGS + CXX_ENDINGS + OBJC_ENDINGS + OBJCXX_ENDINGS + ['.bc', '.ll', '.S']
ASSEMBLY_ENDINGS = ['.s']
HEADER_ENDINGS = ['.h', '.hxx', '.hpp', '.hh', '.H', '.HXX', '.HPP', '.HH']

Expand Down
15 changes: 3 additions & 12 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -12622,18 +12622,9 @@ def test_no_main_with_PROXY_TO_PTHREAD(self):
self.assertContained('crt1_proxy_main.o: undefined symbol: main', err)

def test_archive_bad_extension(self):
# Regression test for https://github.com/emscripten-core/emscripten/issues/14012
# where llvm_nm_multiple would be confused by archives names like object files.
create_file('main.c', '''
#include <sys/socket.h>
int main() {
return (int)(long)&accept;
}
''')

self.run_process([EMCC, '-c', 'main.c'])
self.run_process([EMAR, 'crs', 'libtest.bc', 'main.o'])
self.run_process([EMCC, 'libtest.bc', 'libtest.bc'])
self.run_process([EMCC, '-c', test_file('hello_world.c')])
self.run_process([EMAR, 'crs', 'libtest.bc', 'hello_world.o'])
err = self.expect_fail([EMCC, 'libtest.bc'])

def test_split_dwarf_implicit_compile(self):
# Verify that the dwo file is generated in the current working directory, even when implicitly
Expand Down

0 comments on commit a8b0f0a

Please sign in to comment.