Skip to content

Remove conflicting flags when compiling with bitcode - #7623

Closed
rajivshah3 wants to merge 1 commit into
bazelbuild:masterfrom
rajivshah3:fix/bitcode-flags
Closed

rajivshah3 wants to merge 1 commit into
bazelbuild:masterfrom
rajivshah3:fix/bitcode-flags

Conversation

@rajivshah3

Copy link
Copy Markdown

As mentioned in #4982 , -ffunction-sections and -fdata-sections are not allowed in bitcode (see https://github.com/llvm/llvm-project/blob/394d4ccf693a82dea9b4233db9b7ba98713e54b8/clang/lib/Driver/ToolChains/Clang.cpp#L3647-L3650). As a result, compiling a target using --apple_bitcode=embedded will show this error:

clang: error: -ffunction-sections is not supported with -fembed-bitcode
clang: error: -fdata-sections is not supported with -fembed-bitcode

To fix this, -ffunction-sections and -fdata-sections will only be added on non-bitcode targets

@aiuto
aiuto requested a review from scentini March 6, 2019 04:00
@aiuto aiuto added the z-team-Apple Deprecated. Send to rules_apple, or label team-Rules-CPP + platform:apple label Mar 8, 2019
@keith

keith commented Apr 8, 2019

Copy link
Copy Markdown
Member

@aragos can you review this fix?

@keith

keith commented Apr 9, 2019 •

Copy link
Copy Markdown
Member

this might be superseded by #7986

@aragos

aragos commented Apr 12, 2019

Copy link
Copy Markdown
Contributor

Closing as this is indeed covered more broadly in #7986.

@aragos aragos closed this Apr 12, 2019
@rajivshah3
rajivshah3 deleted the fix/bitcode-flags branch October 17, 2019 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes z-team-Apple Deprecated. Send to rules_apple, or label team-Rules-CPP + platform:apple

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants