On 4/9/21 3:03 PM, Michael Matz wrote: > Hello, > > On Fri, 9 Apr 2021, Mark Wielaard wrote: > >>> We determine native as the result of: >>> - -p: sizeof (void *) >>> - -e: __BYTE_ORDER__ >>> when compiling using CC without CFLAGS, such that if we build dwz with -m32 on >>> x86_64 like so: >>> ... >>> $ make CFLAGS="-m32 -O2 -g" LDFLAGS=-m32 >>> ... >>> and we have: >>> ... >>> $ file ./dwz >>> dwz: ELF 32-bit LSB executable, Intel 80386 >>> ... >>> we still have: >>> ... >>> $ ./dwz -? >>> ... >>> -p, --multifile-pointer-size >>> Set pointer size of multifile, in number of bytes. >>> Native pointer size is 8. >>> Default value: auto. >>> ... >>> >>> Any comments? >> >> Except for this narrow multilib case, doesn't this actually make it >> impossible to do a cross-arch build? > > For cross the term "native" doesn't make sense, so it would seem valid to > simply not support that setting with a cross (not multilib) dwz. I.e. if > ./native can't be executed assume cross-ness and don't support -p native. > I've tried yet another variant. Instead of trying to generate an executable and execute it, we generate an object and test properties using readelf. This should no longer have the cross-build problem. WDYT? Thanks, - Tom