Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erts: Do not use named no_cpuid label in asm #2333

Merged
merged 1 commit into from
Aug 5, 2019

Conversation

matwey
Copy link
Contributor

@matwey matwey commented Jul 26, 2019

Ask compiler to generate unique label name. Using named label has implications
on optimizer, that may lead to the compilation errors as the following:

pthread/ethread.c: Assembler messages:
pthread/ethread.c:213: Error: symbol `no_cpuid' is already defined
pthread/ethread.c:213: Error: symbol `no_cpuid' is already defined
pthread/ethread.c:213: Error: symbol `no_cpuid' is already defined

Please, note, that I faced this build issue in a wild when tried to build Erlang for i686 platform using gcc 9.1.0 with LTO enabled. I suppose that LTO decided to inline function ethr_x86_cpuid__() in the other compilation unit.

Copy link
Contributor

@mikpe mikpe left a comment

Choose a reason for hiding this comment

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

Why not just use a numeric local label, i.e. the usual "jz 1f; ...; 1: ..." idiom?

@matwey
Copy link
Contributor Author

matwey commented Jul 27, 2019

Why not just use a numeric local label, i.e. the usual "jz 1f; ...; 1: ..." idiom?

I'll redo using local labels if you prefer them.

Ask compiler to generate unique label name. Using named label has implications
on optimizer, that may lead to the compilation errors as the following:

    pthread/ethread.c: Assembler messages:
    pthread/ethread.c:213: Error: symbol `no_cpuid' is already defined
    pthread/ethread.c:213: Error: symbol `no_cpuid' is already defined
    pthread/ethread.c:213: Error: symbol `no_cpuid' is already defined
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Jul 29, 2019
@garazdawi garazdawi added fix testing currently being tested, tag is used by OTP internal CI labels Jul 30, 2019
@garazdawi garazdawi self-assigned this Jul 30, 2019
@garazdawi garazdawi merged commit d07ee17 into erlang:maint Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants