Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 948879 - sys-devel/dwz-0.15-r4 failed to build (MUSL): error: expected expression
Summary: sys-devel/dwz-0.15-r4 failed to build (MUSL): error: expected expression
Status: RESOLVED DUPLICATE of bug 945628
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-27 04:22 UTC by Zhixu Liu
Modified: 2025-01-27 05:44 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhixu Liu 2025-01-27 04:22:42 UTC
using profile: default/linux/amd64/23.0/musl/llvm

build will failed:

> readelf: error: unknown argument '-w'
> cc  -O2 -g -Wall -W -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DXXH_INLINE_ALL=1 -DDWZ_VERSION='"0.15"' -DFSF_YEARS='"1992-2021"' -DRH_YEARS='"2001-2021"' -DSUSE_YEARS='"2019-2021"' -c -o args.o args.c -DNATIVE_ENDIAN_VAL=ELFDATA2LSB -DNATIVE_POINTER_SIZE=
> args.c:665:54: error: expected expression
>  665 |               multifile_force_ptr_size = NATIVE_POINTER_SIZE;
>      |                                                             ^
> 1 error generated.
> make: *** [Makefile:50: args.o] Error 1

the reason is NATIVE_POINTER_SIZE is determined by readelf, but llvm-readelf has different arguments w/ gnu readelf, it doesn't accept "-wi".

> NATIVE_POINTER_SIZE=$(shell ${READELF} -wi native.o \
>        | grep "Pointer Size:" \
>        | sed 's/.*: *//')

I don't find other argument of llvm-readelf to get Pointer size, another command llvm-dwarfdump can get addr_size,

> # llvm-dwarfdump --debug-info  /var/tmp/portage/sys-devel/dwz-0.15-r4/work/dwz/native.o
> /var/tmp/portage/sys-devel/dwz-0.15-r4/work/dwz/native.o:       file format elf64-x86-64
>
> .debug_info contents:
> 0x00000000: Compile Unit: length = 0x00000033, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x00000037)

maybe it's best to write a small program to get the native pointer size?




Reproducible: Always
Comment 1 Zhixu Liu 2025-01-27 05:44:57 UTC

*** This bug has been marked as a duplicate of bug 945628 ***