When building with --enable-32-bit, I end up with: make[4]: Entering directory `/home/dema1701/projects/display/mesa/src/gallium/drivers/llvmpipe' g++ -L/usr/lib32/llvm -lpthread -lffi -ldl -lm lp_test_format.o lp_test_main.o -o lp_test_format -Wl,--start-group -L../../auxiliary/ -lgallium libllvmpipe.a -lLLVMMCJIT -lLLVMBitWriter -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -L/usr/lib32 -lXext -lXdamage -lXfixes -lX11-xcb -lX11 -lxcb-glx -lxcb -lXxf86vm -L/usr/lib/i386-linux-gnu/ -ldrm -lm -lpthread -ldl -Wl,--end-group Obviously, I encounter: collect2: error: ld returned 1 exit status make[4]: *** [lp_test_format] Error 1 This can easily be fixed by adding "-m32" to g++. Looking through the Makefile lets me think the flag is not properly propagated. Adding "-m32" at the end of LDFLAGS += $(LLVM_LDFLAGS) makes sense. LLVM_LDFLAGS is defined as LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags` in configure.ac. I don't know about --ldflags, but I'm sure there should be a $CFLASGS or $CCASFLAGS there.
A simple solution is to add $(CXXFLAGS) at the end of LDFLAGS += $(LLVM_LDFLAGS) in llvmpipe's Makefile. This gives: LDFLAGS += $(LLVM_LDFLAGS) $(CXXFLAGS) and it fixes the build. Is it the right place to add it? Any comments? Actually, I think the Makefile itself is wrong compared to others, like under r600.
Created attachment 71708 [details] Add missing CXXFLAGS Fixes cross compiling 32 bit on 64 bit for llvm driver.
Created attachment 72834 [details] [review] Fix llvmpipe crosscompilation It fixes architecture used by linker when using --enable-XY-bit options. Please, review and commit (if the patch is OK). Thank you.
A bunch of automake patches were committed today. Did they fix this, maybe?
(In reply to comment #4) > A bunch of automake patches were committed today. Did they fix this, maybe? Well, forget that, I had this change for a while laying around and the day I put it correctly as a complete patch, we don't need it anymore. ;) It seems fine with the latest changes committed today. I'm closing this bug, it's invalid anymore.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.