[Mesa-dev] [PATCH] mesa: Enable LTO compilation

0xe2.0x9a.0x9b at gmail.com
Tue May 31 18:26:26 UTC 2016

On Tue, May 31, 2016 at 8:04 PM, Chuck Atkins <chuck.atkins at kitware.com> wrote:
> Agreed.  I've been building on both Fedora and EL7 for the past few months
> with -flto and haven't seen any issues with the files in mapi.  You reported
> that you get build failures with gcc for this though so what is your
> particular build environment that is failing and how is it failing?

Build environment: Gentoo, GCC 4.9.3, binutils 2.25.1

The error message:

make[5]: Entering directory 'build32/src/mapi'
/bin/sh ../../libtool  --tag=CC   --mode=link ccache-gcc -pthread
-Werror=pointer-arith -Werror=vla -g -Og -Wall -flto=4 -msse4
-ffat-lto-objects -fuse-linker-plugin -m32 -Wall -std=c99
-Werror=implicit-function-declaration -Werror=missing-prototypes
-fno-strict-aliasing -fno-math-errno -fno-trapping-math
-fno-builtin-memcmp   -no-undefined -Wl,--gc-sections
-Wl,--no-undefined  -o shared-glapi/libglapi.la -rpath install32/lib
shared_glapi_libglapi_la-stub.lo shared_glapi_libglapi_la-table.lo
shared_glapi_libglapi_la-u_execmem.lo -lpthread
libtool: link: ccache-gcc -shared  -fPIC -DPIC
.libs/shared_glapi_libglapi_la-u_execmem.o   -lpthread  -pthread -g
-Og -flto=4 -msse4 -fuse-linker-plugin -m32 -Wl,--gc-sections
-Wl,--no-undefined   -pthread -Wl,-soname -Wl,libglapi.so.0 -o
/tmp/ccuX0CSJ.ltrans5.ltrans.o: In function `entry_patch_public':
src/mapi/entry_x86_tls.h:87: undefined reference to `x86_current_tls'
src/mapi/entry_x86_tls.h:89: undefined reference to `x86_entry_start'
/tmp/ccuX0CSJ.ltrans5.ltrans.o: relocation R_386_GOTOFF against
undefined symbol `x86_entry_start' can not be used when making a
shared object
final link failed: Bad value
collect2: error: ld returned 1 exit status

More information about the mesa-dev mailing list