Closed akadata closed 3 years ago
The point of this hack is, that if $ARCH_DETECTED is "x86_64" but /lib/x86_64-linux-gnu/ doesn't exist, it is actually build running in docker with x86 image on x64 host. Your path will break it.
What exactly fails on archlinux?
The first issue is the arch detection, it detects arch x86 not x64
indigo_aux_dsusb ---------------------------------------
Sources: indigo_aux_dsusb.c indigo_aux_dsusb_main.c Archive: indigo_aux_dsusb.a SO library: indigo_aux_dsusb.so indigo_aux_dsusb.o Executable: indigo_aux_dsusb Rules: dsusb.rules SDK: bin_externals/libdsusb/lib/Linux/x86/libdsusb.a -Ibin_externals/libdsusb/include -Lbin_externals/libdsusb/lib/Linux/x86/ -ldsusb
gcc -g -fPIC -O3 -isystem/usr/src/indigo/indigo_libs -I/usr/src/indigo/indigo_drivers -I/usr/src/indigo/indigo_linux_drivers -I/usr/src/indigo/build/include -std=gnu11 -pthread -DINDIGO_LINUX -Ibin_externals/libdsusb/include -c -o indigo_aux_dsusb.o indigo_aux_dsusb.c ar -rv /usr/src/indigo/build/drivers/indigo_aux_dsusb.a indigo_aux_dsusb.o ar: creating /usr/src/indigo/build/drivers/indigo_aux_dsusb.a a - indigo_aux_dsusb.o gcc -shared -o /usr/src/indigo/build/drivers/indigo_aux_dsusb.so -Wl,--whole-archive /usr/src/indigo/build/drivers/indigo_aux_dsusb.a -Wl,--no-whole-archive -Lbin_externals/libdsusb/lib/Linux/x86/ -ldsusb -lindigo -lm -lrt -lusb-1.0 -pthread -L/usr/src/indigo/build/lib -Wl,-rpath=\$ORIGIN/../lib,-rpath=\$ORIGIN/../drivers,-rpath=. -lusb-1.0 /usr/bin/ld: skipping incompatible bin_externals/libdsusb/lib/Linux/x86//libdsusb.a when searching for -ldsusb /usr/bin/ld: cannot find -ldsusb collect2: error: ld returned 1 exit status make[2]: [../../Makefile.drv:121: /usr/src/indigo/build/drivers/indigo_aux_dsusb.so] Error 1 make[2]: Leaving directory '/usr/src/indigo/indigo_drivers/aux_dsusb' make[1]: [../Makefile.drvs:66: aux_dsusb/] Error 2 make[1]: Leaving directory '/usr/src/indigo/indigo_drivers' make: *** [Makefile:127: all] Error 2
Maybe the easiest workaround is to create /lib/x86_64-linux-gnu folder.
See there is a problem there as my x86_64-linux-gnu folder is here /lib/gcc/x86_64-pc-linux-gnu
and I do not really want to be creating symlinks for software that does not know where my libs are so it will install and as such I think the Makefile should check for more places before assuming x86 .
Or why not use uname -m to get the same information rather than relying on file system
You don't need to make a symlink, just create empty folder.
We use uname, see line 67. The subsequent code just corrects the value returned by uname, because it is wrong.
Without argument, but why should I create an empty folder to make something build?
And on further inspection I think my issue is really "wildcard" is not not found on my system and does not appear to exist either.
ifeq ($(ARCH_DETECTED),x86_64) ifeq ($(wildcard /lib/x86_64-linux-gnu/),) ARCH_DETECTED = x86 DEBIAN_ARCH = i386 else ARCH_DETECTED = x64
Because Makefile tests the existence of standard location /lib/x86_64-linux-gnu (while on your system they are on a nonstandard location /lib/gcc/x86_64-pc-linux-gnu) to detect if it is really a 64 bit system.
"wildcard" is a command, not a pathname.
akadata-archlinux.patch.txt
Symptoms are build errors, first error related to x64 not sure why an x86_64-linux-gnu would want to be x86 unless they dont use x64
Patch attached allows a clean build on arch
[asmalley@homer indigo]$ uname -a; gcc -v Linux homer 5.7.12-arch1-1 #1 SMP PREEMPT Fri, 31 Jul 2020 17:38:22 +0000 x86_64 GNU/Linux Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.1.0 (GCC)