Bug 104818 - mesa fails to build on ia64
Summary: mesa fails to build on ia64
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-28 04:10 UTC by Jason Duerstock
Modified: 2018-01-29 11:57 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Jason Duerstock 2018-01-28 04:10:53 UTC
This is more or less the same bug as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884356 , but with some additional information/questions.

On ia64, --gc-sections is not implemented in binutils, and linkage in a number of places.  On a whim, I build mesa on amd64 and removed --gc-sections, and ran into some similar errors.

I can't quite figure out how to fix the makefiles and dependencies, but is it reasonable to expect things to build properly even if --gc-sections is not available?
Comment 1 Robert Wahlstedt 2018-01-29 00:49:43 UTC
Hello, ia64 may not be a platform commonly supported. From Wikipedia “The Itanium architecture is based on explicit instruction-level parallelism, in which the compiler decides which instructions to execute in parallel. This contrasts with other superscalar architectures, which depend on the processor to manage instruction dependencies at runtime. In all Itanium models, up to and including Tukwila, cores execute up to six instructions per clock cycle.” Therefore I am recommending you try these steps: sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
sudo ./adb

This would run the program in 32 bit mode for ia
Comment 2 Jason Duerstock 2018-01-29 00:54:15 UTC
This is explicitly on an ia64 machine, not on i386 or amd64.

$ uname -a
Linux deb-ia64 3.14-0.bpo.2-mckinley #1 SMP Debian 3.14.15-2~bpo70+1 (2014-08-21) ia64 GNU/Linux

$ cat /proc/cpuinfo
processor  : 0
vendor     : GenuineIntel
arch       : IA-64
family     : 31
model      : 1
model name : Madison
revision   : 5
archrev    : 0
features   : branchlong
cpu number : 0
cpu regs   : 4
cpu MHz    : 1495.950
itc MHz    : 1495.950997
BogoMIPS   : 2232.32
siblings   : 1
physical id: 0

processor  : 1
vendor     : GenuineIntel
arch       : IA-64
family     : 31
model      : 1
model name : Madison
revision   : 5
archrev    : 0
features   : branchlong
cpu number : 0
cpu regs   : 4
cpu MHz    : 1495.950
itc MHz    : 1495.950997
BogoMIPS   : 2232.32
siblings   : 1
physical id: 0
Comment 3 Jason Duerstock 2018-01-29 01:04:29 UTC
The full build log from the Debian builder:

https://buildd.debian.org/status/fetch.php?pkg=mesa&arch=ia64&ver=17.3.3-1&stamp=1516394211&raw=0
Comment 4 Emil Velikov 2018-01-29 11:07:43 UTC
Thanks for the report Jason.

For the future, please include a snippet of the failure in the report. Namely:

./build/src/util/../../../src/util/u_thread.h:48: undefined reference to `pthread_sigmask'
...
collect2: error: ld returned 1 exit status
Makefile:847: recipe for target 'libgbm.la' failed


The issue is resolved by commit 3ce16804869 ("link mesautil with pthreads") - can you confirm if that's the case? I'll tag it for the stable releases and check to propagates accordingly.
Comment 5 Jason Duerstock 2018-01-29 11:44:35 UTC
Hi Emil,

Yes, that fixed the pthread problem.  Originally, I was trying to troubleshoot this:

libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/ia64-linux-gnu/7/../../../ia64-linux-gnu/crti.o /usr/lib/gcc/ia64-linux-gnu/7/crtbeginS.o  .libs/gallium_drv_video_la-target.o  -Wl,--whole-archive ../../../../src/gallium/state_trackers/va/.libs/libvatracker.a ../../../../src/gallium/auxiliary/.libs/libgalliumvlwinsys.a ../../../../src/gallium/auxiliary/.libs/libgalliumvl.a ../../../../src/gallium/auxiliary/.libs/libgallium.a ../../../../src/util/.libs/libmesautil.a ../../../../src/gallium/auxiliary/pipe-loader/.libs/libpipe_loader_static.a ../../../../src/gallium/winsys/sw/null/.libs/libws_null.a ../../../../src/gallium/winsys/sw/wrapper/.libs/libwsw.a ../../../../src/gallium/winsys/sw/dri/.libs/libswdri.a ../../../../src/gallium/winsys/sw/kms-dri/.libs/libswkmsdri.a ../../../../src/gallium/winsys/nouveau/drm/.libs/libnouveaudrm.a ../../../../src/gallium/drivers/nouveau/.libs/libnouveau.a ../../../../src/gallium/drivers/r600/.libs/libr600.a ../../../../src/gallium/winsys/radeon/drm/.libs/libradeonwinsys.a -Wl,--no-whole-archive  -lz -lsensors -lpthread -ldl -lxcb-dri2 -lX11-xcb -lX11 -lxcb -lxcb-dri3 -lxcb-xfixes -lxcb-present -lxcb-sync -lxshmfence -lexpat -ldrm_nouveau -ldrm_radeon -ldrm -L/usr/lib/gcc/ia64-linux-gnu/7 -L/usr/lib/gcc/ia64-linux-gnu/7/../../../ia64-linux-gnu -L/usr/lib/gcc/ia64-linux-gnu/7/../../.. -L/lib/ia64-linux-gnu -L/usr/lib/ia64-linux-gnu -lstdc++ -lm -lc -lgcc_s -lunwind /usr/lib/gcc/ia64-linux-gnu/7/crtendS.o /usr/lib/gcc/ia64-linux-gnu/7/../../../ia64-linux-gnu/crtn.o  -g -O2 -Wl,--gc-sections -Wl,--no-undefined -Wl,--version-script=../../../../../src/gallium/targets/va/va.sym -pthread   -pthread -Wl,-soname -Wl,gallium_drv_video.so -o .libs/gallium_drv_video.so
/usr/bin/ld: Warning: gc-sections option ignored
../../../../src/gallium/auxiliary/.libs/libgallium.a(tgsi_to_nir.o): In function `nir_build_imm':
./build/src/gallium/auxiliary/../../../../src/compiler/nir/nir_builder.h:196: undefined reference to `nir_load_const_instr_create'
../../../../src/gallium/auxiliary/.libs/libgallium.a(tgsi_to_nir.o): In function `nir_builder_instr_insert':
./build/src/gallium/auxiliary/../../../../src/compiler/nir/nir_builder.h:65: undefined reference to `nir_instr_insert'
../../../../src/gallium/auxiliary/.libs/libgallium.a(tgsi_to_nir.o): In function `nir_imov_alu':
./build/src/gallium/auxiliary/../../../../src/compiler/nir/nir_builder.h:405: undefined reference to `nir_alu_instr_create'
./build/src/gallium/auxiliary/../../../../src/compiler/nir/nir_builder.h:406: undefined reference to `nir_ssa_dest_init'
...
../../../../src/gallium/auxiliary/.libs/libgallium.a(tgsi_to_nir.o):(.sdata+0x28): more undefined references to `nir_op_infos' follow
collect2: error: ld returned 1 exit status
Makefile:814: recipe for target 'gallium_drv_video.la' failed
make[5]: *** [gallium_drv_video.la] Error 1
make[5]: Leaving directory '/<<PKGBUILDDIR>>/build/src/gallium/targets/va'
Makefile:611: recipe for target 'all-recursive' failed
make[4]: *** [all-recursive] Error 1

This is what it takes to make it build currently on Debian/ia64:

--- src/gallium/drivers/radeonsi/Automake.inc   2018-01-23 13:08:50.000000000 -0500
+++ /home/jason/Automake.inc    2018-01-29 06:38:24.235489245 -0500
@@ -1,3 +1,6 @@
+TARGET_COMPILER_LIB_DEPS = \
+       $(top_builddir)/src/compiler/nir/libnir.la
+
 if HAVE_GALLIUM_RADEONSI

 TARGET_DRIVERS += radeonsi
@@ -8,9 +11,6 @@
        $(LIBDRM_LIBS) \
        $(AMDGPU_LIBS)

-TARGET_COMPILER_LIB_DEPS = \
-       $(top_builddir)/src/compiler/nir/libnir.la
-
 TARGET_RADEON_WINSYS = \
        $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
        $(top_builddir)/src/gallium/winsys/amdgpu/drm/libamdgpuwinsys.la

I don't know if this is the right fix or not, but it works for me.
Comment 6 Emil Velikov 2018-01-29 11:57:21 UTC
Great - one sorted, one left.

Please keep separate issues different bug reports - a minimal configure invocation that illustrates the issue will be appreciated.


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.