Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 738890 - sys-devel/llvm: llvm-objdump does not recognize '-g' option (was: dev-util/ccache-3.7.11 fails tests)
Summary: sys-devel/llvm: llvm-objdump does not recognize '-g' option (was: dev-util/cc...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-25 05:12 UTC by Agostino Sarubbo
Modified: 2020-08-25 12:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,20.89 KB, text/plain)
2020-08-25 05:12 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2020-08-25 05:12:53 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-util/ccache-3.7.11 fails tests.
Discovered on: amd64 (internal ref: tinderbox)

NOTE:
This machine uses a clang/LLVM toolchain.
If you think that this issue is strictly related to clang/LLVM please block bug 408963. If you think that this issue is strictly related to the LLD linker, please block bug 731004.
This machine uses also GLIBC-2.32. If you think that this issue is strictly related to GLIBC please block bug 736174.
Comment 1 Agostino Sarubbo gentoo-dev 2020-08-25 05:12:56 UTC
Created attachment 656560 [details]
build.log

build log and emerge --info
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2020-08-25 06:54:02 UTC
I can't reproduce it on glibc-2.32 using clang and lld:

$ MAKEOPTS="-j16 V=1" CC=x86_64-pc-linux-gnu-clang CXX=x86_64-pc-linux-gnu-clang++ CFLAGS="-O2 -pipe -march=native -frecord-gcc-switches -fno-diagnostics-color" CXXFLAGS="-O2 -pipe -march=native -frecord-gcc-switches -fno-diagnostics-color" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -fuse-ld=lld" ebuild ccache-3.7.11.ebuild clean install

...

> Running test suite debug_prefix_map..
> Running test suite profiling.....

The test fails at

"""
    if ! objdump_cmd test.o | grep_cmd "name" src/test.c >/dev/null 2>&1; then
        test_failed "Relocation (name) not found in test.o"
    fi
"""

Do you override OBJDUMP variable as well?
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2020-08-25 06:55:40 UTC
Setting OBJDUMP=llvm-objdump helps:

$ OBJDUMP=llvm-objdump MAKEOPTS="-j16 V=1" CC=x86_64-pc-linux-gnu-clang CXX=x86_64-pc-linux-gnu-clang++ CFLAGS="-O2 -pipe -march=native -frecord-gcc-switches -fno-diagnostics-color" CXXFLAGS="-O2 -pipe -march=native -frecord-gcc-switches -fno-diagnostics-color" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -fuse-ld=lld" ebuild ccache-3.7.11.ebuild clean install

> Test suite:     debug_prefix_map
> Test case:      Multiple -fdebug-prefix-map
> Failure reason: Relocation (name) not found in test.o
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2020-08-25 07:03:30 UTC
Does not look like llvm-objdump supports '-g' option:

$ LANG=C x86_64-pc-linux-gnu-objdump -g test.o | fgrep name
  0x00000020 006e616d 65007465 73740069 6e7400   .name.test.int.
    DW_AT_name         DW_FORM_strp
    DW_AT_name         DW_FORM_strp
    DW_AT_name         DW_FORM_strp
    <12>   DW_AT_name        : (indirect string, offset: 0x16): src/test.c
    <1a>   DW_AT_comp_dir    : (indirect string, offset: 0x21): name
    <1f>   DW_AT_name        : (indirect string, offset: 0x26): test
    <34>   DW_AT_name        : (indirect string, offset: 0x2b): int

$ LANG=C llvm-objdump -g test.o | fgrep name
  --arch-name=<string>             - Target arch to disassemble for, see -version for available targets
  --demangle                       - Demangle symbols names
  --dis-symname=<string>           - disassemble just this symbol's instructions (requires -macho)
  --disassemble-functions=<string> - List of functions to disassemble. Accept demangled names when --demangle is specified, otherwise accept mangled names
  --mcpu=<cpu-name>                - Target a specific cpu type (-mcpu=help for details)

I don't know of llvm-objdump can be used as objdump. Up to llvm maintainer.
Comment 5 Agostino Sarubbo gentoo-dev 2020-08-25 12:43:30 UTC
(In reply to Sergei Trofimovich from comment #2)
> Do you override OBJDUMP variable as well?

Yes with llvm-objdump as you already tried