Skip to content

Perform "linking to object file" as separate phase.#9444

Merged
sbc100 merged 1 commit into
incomingfrom
separate_object_linking
Sep 19, 2019
Merged

Perform "linking to object file" as separate phase.#9444
sbc100 merged 1 commit into
incomingfrom
separate_object_linking

Conversation

@sbc100

@sbc100 sbc100 commented Sep 17, 2019

Copy link
Copy Markdown
Collaborator

This change moves the "linking to object file" logic to separate
phase which runs after compilation, but before the real "linking"
phase. We can also delay library processing until after this phase
as that is only needed for actual linking.

This change is a step towards more conventional library linking
See #8912.

@sbc100 sbc100 requested a review from kripken September 17, 2019 19:30
@sbc100 sbc100 force-pushed the separate_object_linking branch from 6961722 to c61ff2e Compare September 17, 2019 22:13
Comment thread emcc.py
out_dep.write(deps)
# Specifying -o with multiple input source files is not allowed.
# We error out much earlier in this case.
assert len(input_files) == 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user does provide multiple inputs with -o, is the error message shown the assertion here failing? (if so I worry it may not be clear enough)

Is this a breaking change?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there is an earlier error for that case. This assert is as a fall back / internal consistency check.

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks, lgtm.

@sbc100 sbc100 force-pushed the separate_object_linking branch 2 times, most recently from 2c9eb85 to 4f92c6b Compare September 18, 2019 19:54
This change moves the "linking to object file" logic to separate
phase which runs after compilation, but before the real "linking"
phase.  We can also delay library processing until after this phase
as that is only needed for actual linking.

This change is a step towards more conventional library linking
See #8912.
@sbc100 sbc100 force-pushed the separate_object_linking branch from 29e5749 to 1efce29 Compare September 19, 2019 01:03
@sbc100 sbc100 merged commit 0305b34 into incoming Sep 19, 2019
@sbc100 sbc100 deleted the separate_object_linking branch September 19, 2019 02:26
sbc100 added a commit that referenced this pull request Sep 21, 2019
On mac, libtool/autoconf will often add `-Wl,-bind_at_load` at link
time which was causing and error when passed down the lld.

Add a blacklist of linker flags we don't support in lld to avoid this
issue.  This seems easier than trying to tell autoconf/libtool that
we are really cross compiling and it shouldn't add darwin-specific
flags.

This was broken in #9444 beforewhich file same linker flag filter
was used for lld and llvm-link when compiling to and object file (i.e.
when building a shared library).
sbc100 added a commit that referenced this pull request Sep 21, 2019
On mac, libtool/autoconf will often add `-Wl,-bind_at_load` at link
time which was causing and error when passed down the lld.

Add a blacklist of linker flags we don't support in lld to avoid this
issue.  This seems easier than trying to tell autoconf/libtool that
we are really cross compiling and it shouldn't add darwin-specific
flags.

This was broken in #9444 beforewhich file same linker flag filter
was used for lld and llvm-link when compiling to and object file (i.e.
when building a shared library).
sbc100 added a commit that referenced this pull request Sep 26, 2019
Without `-c` emscripten will try to run lld on the object files its
given to produce another object file.  We should probably disable that
for the single build case.  This breakage was introduced in #9444 and
we should probably address it, but compiling without `-c` is also
broken so fixing here.

Fixes #9510
sbc100 added a commit that referenced this pull request Sep 26, 2019
Without `-c` emscripten will try to run lld on the object files its
given to produce another object file.  We should probably disable that
for the single build case.  This breakage was introduced in #9444 and
we should probably address it, but compiling without `-c` is also
broken so fixing here.

Fixes #9510
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
…9444)

This change moves the "linking to object file" logic to separate
phase which runs after compilation, but before the real "linking"
phase.  We can also delay library processing until after this phase
as that is only needed for actual linking.

This change is a step towards more conventional library linking
See emscripten-core#8912.
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
On mac, libtool/autoconf will often add `-Wl,-bind_at_load` at link
time which was causing and error when passed down the lld.

Add a blacklist of linker flags we don't support in lld to avoid this
issue.  This seems easier than trying to tell autoconf/libtool that
we are really cross compiling and it shouldn't add darwin-specific
flags.

This was broken in emscripten-core#9444 beforewhich file same linker flag filter
was used for lld and llvm-link when compiling to and object file (i.e.
when building a shared library).
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
Without `-c` emscripten will try to run lld on the object files its
given to produce another object file.  We should probably disable that
for the single build case.  This breakage was introduced in emscripten-core#9444 and
we should probably address it, but compiling without `-c` is also
broken so fixing here.

Fixes emscripten-core#9510
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants