Skip to content

Set compiler flags for ASM same as for C/CXX#37479

Merged
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
azat:fix-flags-for-asm
May 24, 2022
Merged

Set compiler flags for ASM same as for C/CXX#37479
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
azat:fix-flags-for-asm

Conversation

@azat
Copy link
Copy Markdown
Member

@azat azat commented May 24, 2022

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Set compiler flags for ASM same as for C/CXX

This should fix DWARF version for ASM sources (from #34754):

$ llvm-dwarfdump -r 1 clickhouse | grep Compile -A10 | grep -A10 'version = 0x0005'
...
--
0x1de11022: Compile Unit: length = 0x000000e7, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x551dc0, addr_size = 0x08 (next unit at 0x1de1110d)

0x1de1102e: DW_TAG_compile_unit
              DW_AT_stmt_list   (0x057e3442)
              DW_AT_low_pc      (0x00000000101cde0c)
              DW_AT_high_pc     (0x00000000101cde5e)
              DW_AT_name        ("/ClickHouse/contrib/libunwind/src/UnwindRegistersSave.S")
              DW_AT_comp_dir    ("/fasttest-workspace/build")
              DW_AT_producer    ("Ubuntu clang version 14.0.1-++20220426083040+0e27d08cdeb3-1~exp1~20220426083051.129")
              DW_AT_language    (DW_LANG_Mips_Assembler)
...

Follow-up for: #34777 (cc @alexey-milovidov)

This should fix DWARF version for ASM sources (from ClickHouse#34754):

    $ llvm-dwarfdump -r 1 clickhouse | grep Compile -A10 | grep -A10 'version = 0x0005'
    ...
    --
    0x1de11022: Compile Unit: length = 0x000000e7, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x551dc0, addr_size = 0x08 (next unit at 0x1de1110d)

    0x1de1102e: DW_TAG_compile_unit
                  DW_AT_stmt_list   (0x057e3442)
                  DW_AT_low_pc      (0x00000000101cde0c)
                  DW_AT_high_pc     (0x00000000101cde5e)
                  DW_AT_name        ("/ClickHouse/contrib/libunwind/src/UnwindRegistersSave.S")
                  DW_AT_comp_dir    ("/fasttest-workspace/build")
                  DW_AT_producer    ("Ubuntu clang version 14.0.1-++20220426083040+0e27d08cdeb3-1~exp1~20220426083051.129")
                  DW_AT_language    (DW_LANG_Mips_Assembler)
    ...

Follow-up for: ClickHouse#34777 (cc @alexey-milovidov)
Signed-off-by: Azat Khuzhin <[email protected]>
@azat azat mentioned this pull request May 24, 2022
@robot-ch-test-poll robot-ch-test-poll added the pr-not-for-changelog This PR should not be mentioned in the changelog label May 24, 2022
@azat azat marked this pull request as ready for review May 24, 2022 12:20
@alexey-milovidov alexey-milovidov self-assigned this May 24, 2022
@alexey-milovidov alexey-milovidov merged commit 4a9e95d into ClickHouse:master May 24, 2022
@azat azat deleted the fix-flags-for-asm branch May 25, 2022 06:39
@azat
Copy link
Copy Markdown
Member Author

azat commented May 25, 2022

Now binary should have DWARF4 everywhere:

Before this PR:

$ llvm-dwarfdump -r 1 clickhouse.upstream | grep 'Compile Unit:' | grep -E -o 'version = 0x[0-9]{4}' | sort | uniq -c
   2142 version = 0x0004
      7 version = 0x0005
# binary from fast-test, that's why less compilation units there

After this PR:

$ llvm-dwarfdump -r 1 clickhouse.patched | grep 'Compile Unit:' | grep -E -o 'version = 0x[0-9]{4}' | uniq -c
   4786 version = 0x0004 # <!-- DWARF4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants