Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 730722 - dev-util/radare2-4.4.0-r1 fails to compile: crtbeginS.o is incompatible with elf_x86_64
Summary: dev-util/radare2-4.4.0-r1 fails to compile: crtbeginS.o is incompatible with ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Sergei Trofimovich (RETIRED)
URL: https://github.com/aquynh/capstone/pu...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-04 13:42 UTC by Agostino Sarubbo
Modified: 2020-07-04 18:04 UTC (History)
1 user (show)

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


Attachments
build.log.bz2 (build.log.bz2,20.28 KB, application/x-bzip-compressed-tar)
2020-07-04 13:42 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-07-04 13:42:22 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-util/radare2 fails to compile.
Discovered on: amd64

NOTE:
This machine uses a clang/LLVM toolchain.
If you think that this issue is strictly related to clang/LLVM please mention it in the summary and block bug 408963. If you need further logs, feel free to ask.
Comment 1 Agostino Sarubbo gentoo-dev 2020-07-04 13:42:28 UTC
Created attachment 647578 [details]
build.log.bz2

build log and emerge --info
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2020-07-04 17:24:02 UTC
The build fails as:

"""
"x86_64-pc-linux-gnu-clang -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -L/usr/lib -lcapstone -fvisibility=hidden -shared -o libr_asm.so -Wl,-soname=libr_asm.so p/asm_6502.o p/asm_6502_cs.o p/asm_8051.o p/../arch/8051/8051_disas.o p/../arch/8051/8051_ass.o p/asm_amd29k.o p/../arch/amd29k/amd29k.o p/asm_arc.o p/../arch/arc/gnu/arc-dis.o p/../arch/arc/gnu/arc-ext.o p/../arch/arc/gnu/arc-opc.o p/../arch/arc/gnu/arcompact-dis.o p/asm_arm_as.o p/asm_arm_cs.o p/../arch/arm/armass.o p/../arch/arm/armass64.o p/asm_arm_gnu.o p/../arch/arm/gnu/arm-dis.o p/../arch/arm/gnu/floatformat.o p/../arch/arm/aarch64/aarch64-dis.o p/../arch/arm/aarch64/aarch64-dis-2.o p/../arch/arm/aarch64/aarch64-opc.o p/../arch/arm/aarch64/aarch64-opc-2.o p/asm_arm_winedbg.o p/../arch/arm/winedbg/be_arm.o p/asm_avr.o p/asm_bf.o p/asm_chip8.o p/asm_cr16.o /var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/asm/arch/cr16/cr16_disas.o p/asm_cris_gnu.o p/../arch/cris/gnu/cris-dis.o p/../arch/cris/gnu/cris-opc.o p/asm_dalvik.o p/asm_dcpu16.o p/asm_ebc.o /var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/asm/arch/ebc/ebc_disas.o p/asm_gb.o p/asm_h8300.o /var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/asm/arch/h8300/h8300_disas.o p/asm_hexagon.o p/../arch/hexagon/hexagon.o p/../arch/hexagon/hexagon_disas.o p/asm_hppa_gnu.o p/../arch/hppa/gnu/hppa-dis.o p/asm_i4004.o p/asm_i8080.o p/asm_java.o p/asm_lanai_gnu.o p/../arch/lanai/gnu/lanai-dis.o p/../arch/lanai/gnu/lanai-opc.o p/asm_lh5801.o p/asm_lm32.o p/asm_m680x_cs.o p/asm_m68k_cs.o p/asm_malbolge.o p/asm_mcore.o p/../arch/mcore/mcore.o p/asm_mcs96.o p/asm_mips_cs.o p/../arch/mips/mipsasm.o p/asm_mips_gnu.o p/../arch/mips/gnu/mips-dis.o p/../arch/mips/gnu/mips16-opc.o p/../arch/mips/gnu/mips-opc.o p/asm_msp430.o /var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/asm/arch/msp430/msp430_disas.o p/asm_nios2.o p/../arch/nios/gnu/nios2-dis.o p/../arch/nios/gnu/nios2-opc.o p/asm_null.o p/asm_or1k.o p/../arch/or1k/or1k_disas.o p/asm_pic.o p/../arch/pic/pic_baseline.o p/../arch/pic/pic_pic18.o p/../arch/pic/pic_midrange.o p/asm_ppc_cs.o p/../arch/ppc/libvle/vle.o p/../arch/ppc/libps/libps.o p/asm_ppc_gnu.o p/../arch/ppc/gnu/ppc-dis.o p/../arch/ppc/gnu/ppc-opc.o p/asm_propeller.o p/../arch/propeller/propeller_disas.o p/asm_riscv.o p/asm_riscv_cs.o p/asm_rsp.o /var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/asm/arch/rsp/rsp_idec.o p/asm_sh.o p/../arch/sh/gnu/sh-dis.o p/asm_snes.o p/asm_sparc_cs.o p/asm_sparc_gnu.o p/../arch/sparc/gnu/sparc-dis.o p/../arch/sparc/gnu/sparc-opc.o p/asm_spc700.o p/asm_sysz.o p/asm_tms320.o p/../arch/tms320/tms320_dasm.o p/../arch/tms320/c55x_plus/c55plus.o p/../arch/tms320/c55x_plus/c55plus_decode.o p/../arch/tms320/c55x_plus/decode_funcs.o p/../arch/tms320/c55x_plus/hashtable.o p/../arch/tms320/c55x_plus/ins.o p/../arch/tms320/c55x_plus/utils.o p/asm_tricore.o p/../arch/tricore/gnu/tricore-dis.o p/../arch/tricore/gnu/tricore-opc.o p/../arch/tricore/gnu/cpu-tricore.o p/asm_v810.o p/../arch/v810/v810_disas.o p/asm_v850.o /var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/asm/arch/v850/v850_disas.o p/asm_vax.o p/../arch/vax/vax-dis.o p/asm_wasm.o /var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/asm/arch/wasm/wasm.o p/asm_ws.o p/asm_x86_as.o p/asm_x86_cs.o p/asm_x86_nasm.o p/asm_x86_nz.o p/asm_xap.o p/asm_xcore_cs.o p/asm_xtensa.o p/../arch/xtensa/gnu/xtensa-dis.o p/../arch/xtensa/gnu/xtensa-isa.o p/../arch/xtensa/gnu/xtensa-modules.o p/../arch/xtensa/gnu/elf32-xtensa.o p/asm_z80.o asm.o acode.o aop.o            -L/var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/syscall -L/var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/lang -L/var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/util -L/var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/parse -L/var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/flag -L/var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/cons -L/var/tmp/portage/dev-util/radare2-4.4.0-r1/work/radare2-4.4.0/libr/reg -lr_syscall -lr_lang -lr_util -lr_parse -lr_flag -lr_cons -lr_reg   -fPIC ../..//shlr/java/libr_java.a -L/usr/lib -lcapstone -fvisibility=hidden   -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0 -L/usr/lib -lcapstone -fvisibility=hidden"
ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../lib64/crti.o is incompatible with elf_x86_64
ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/crtbeginS.o is incompatible with elf_x86_64
ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../lib64/libcapstone.so is incompatible with elf_x86_64
ld.lld: error: p/asm_6502.o is incompatible with elf_x86_64
ld.lld: error: p/asm_6502_cs.o is incompatible with elf_x86_64
ld.lld: error: p/asm_8051.o is incompatible with elf_x86_64
ld.lld: error: p/../arch/8051/8051_disas.o is incompatible with elf_x86_64
ld.lld: error: p/../arch/8051/8051_ass.o is incompatible with elf_x86_64
ld.lld: error: p/asm_amd29k.o is incompatible with elf_x86_64
ld.lld: error: p/../arch/amd29k/amd29k.o is incompatible with elf_x86_64
ld.lld: error: p/asm_arc.o is incompatible with elf_x86_64
ld.lld: error: p/../arch/arc/gnu/arc-dis.o is incompatible with elf_x86_64
ld.lld: error: p/../arch/arc/gnu/arc-ext.o is incompatible with elf_x86_64
ld.lld: error: p/../arch/arc/gnu/arc-opc.o is incompatible with elf_x86_64
"""

I assume that your system mostly works with this setting and /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/crtbeginS.o is an ELF64 file ('file' should confirm.

The actual bug is probably in '-L/usr/lib -lcapstone'. That should be -L/usr/lib64 (or no library path at all). Let's see if I can find where it comes from.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2020-07-04 17:35:08 UTC
Ah, it's a bug in dev-libs/capstone library:

$ cat /usr/lib64/pkgconfig/capstone.pc
libdir=${prefix}/lib

Should be a lib64. Probably an artifact of moving capstone to cmake. The bug  is exposed by lld linker which does not have /usr/lib search path: LDFLAGS="-Wl,-O1 -Wl,--as-needed -fuse-ld=lld" 

Looking.
Comment 4 Larry the Git Cow gentoo-dev 2020-07-04 17:52:11 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=878bbb63fd18d2aaaa7496bba1fda39948773820

commit 878bbb63fd18d2aaaa7496bba1fda39948773820
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-07-04 17:51:53 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-07-04 17:52:06 +0000

    dev-libs/capstone: install into --libdir=
    
    Reported-by: Agostino Sarubbo
    Closes: https://bugs.gentoo.org/730722
    Package-Manager: Portage-2.3.103, Repoman-2.3.23
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 dev-libs/capstone/capstone-4.0.2-r2.ebuild         | 74 ++++++++++++++++++++++
 .../capstone/files/capstone-4.0.2-libsuffix.patch  | 12 ++++
 2 files changed, 86 insertions(+)
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2020-07-04 18:03:54 UTC
Proposed cleaner fix upstream as https://github.com/aquynh/capstone/pull/1659
Comment 6 Larry the Git Cow gentoo-dev 2020-07-04 18:04:37 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fdff36839aec81790a39d14109d2bce76283c94d

commit fdff36839aec81790a39d14109d2bce76283c94d
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-07-04 18:04:26 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-07-04 18:04:26 +0000

    dev-libs/capstone: rely on CMAKE_INSTALL_LIBDIR
    
    Bug: https://bugs.gentoo.org/730722
    Package-Manager: Portage-2.3.103, Repoman-2.3.23
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 dev-libs/capstone/files/capstone-4.0.2-libsuffix.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)