Hi,
Today [1] , I have updated libprojectM package with new autotools builds (developer changed etc). It builds fine in F28 on i686 but not in F29 or newer.
After read [2] it exactly the same problem, only added -shared fix the build, not -lgcc etc ...
I tried build on i686 with [3] but configure stops [4] and checking config.log [5] even more crazy : Segmentation fault (core dumped) .
But in F28 compiles well , which makes me think is a gcc bug .
Best regards,
[1] https://koji.fedoraproject.org/koji/taskinfo?taskID=33444082
[2] https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/...
[3] export LDFLAGS="%{?__global_ldflags} -shared"
[4] checking whether we are cross compiling... configure: error: in `/builddir/build/BUILD/projectm-3.1.1-rc3':
[5] configure:3894: checking whether we are cross compiling configure:3902: gcc -o conftest -O2 -g -pipe -Wall -Werror=format- security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous- unwind-tables -fstack-clash-protection -fcf-protection -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened- ld -shared conftest.c >&5 configure:3906: $? = 0 configure:3913: ./conftest ./configure: line 3915: 1447 Segmentation fault (core dumped) ./conftest$ac_cv_exeext configure:3917: $? = 139 configure:3924: error: in `/builddir/build/BUILD/projectm-3.1.1-rc3': configure:3926: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details
* Sérgio Basto:
[3] export LDFLAGS="%{?__global_ldflags} -shared"
Not sure why you think this would work. It prevents the compiler from creating any executables at all.
The problem is earlier, here:
libtool: link: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/i686-redhat-linux/9/../../../crti.o /usr/lib/gcc/i686-redhat-linux/9/crtbeginS.o .libs/ConfigFile.o .libs/Preset.o .libs/PresetLoader.o .libs/timer.o .libs/KeyHandler.o .libs/PresetChooser.o .libs/TimeKeeper.o .libs/PCM.o .libs/PresetFactory.o .libs/fftsg.o .libs/wipemalloc.o .libs/PipelineMerger.o .libs/PresetFactoryManager.o .libs/projectM.o .libs/TestRunner.o -Wl,--whole-archive ../libprojectM/MilkdropPresetFactory/.libs/libMilkdropPresetFactory.a ../libprojectM/NativePresetFactory/.libs/libNativePresetFactory.a ../libprojectM/Renderer/.libs/libRenderer.a -Wl,--no-whole-archive -lGL -ldl -L/usr/lib/gcc/i686-redhat-linux/9 -L/usr/lib/gcc/i686-redhat-linux/9/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/i686-redhat-linux/9/crtendS.o /usr/lib/gcc/i686-redhat-linux/9/../../../crtn.o -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -O2 -g -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -pthread -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -pthread -pthread -Wl,-soname -Wl,libprojectM.so.3 -o .libs/libprojectM.so.3.1.1
That linker command is just wrong. You just can't use -nostdlib in this way. There is no reference to libgcc, which is implicitly provided without -nostdlib.
I don't know why libtool attempts to link with -nostdlib.
Thanks, Florian
On Wed, 2019-03-13 at 10:29 +0100, Florian Weimer wrote:
- Sérgio Basto:
[3] export LDFLAGS="%{?__global_ldflags} -shared"
Not sure why you think this would work. It prevents the compiler from creating any executables at all.
With -shared fixed this generation of binaries [1], it is a tip mention in old thread mention in my previous email, AFAIU.
[1] g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous- unwind-tables -fstack-clash-protection -fcf-protection -pthread -std=c++11 -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o projectM-unittest projectM-unittest.o getConfigFilename.o -pthread -lSDL2 ../libprojectM/.libs/libprojectM.so -lGL -ldl -pthread - D__LIBTOOL_NO_RPATH__ -shared
The problem is earlier, here:
libtool: link: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/i686-redhat-linux/9/../../../crti.o /usr/lib/gcc/i686-redhat-linux/9/crtbeginS.o .libs/ConfigFile.o .libs/Preset.o .libs/PresetLoader.o .libs/timer.o .libs/KeyHandler.o .libs/PresetChooser.o .libs/TimeKeeper.o .libs/PCM.o .libs/PresetFactory.o .libs/fftsg.o .libs/wipemalloc.o .libs/PipelineMerger.o .libs/PresetFactoryManager.o .libs/projectM.o .libs/TestRunner.o -Wl,--whole-archive
../libprojectM/MilkdropPresetFactory/.libs/libMilkdropPresetFactory.a ../libprojectM/NativePresetFactory/.libs/libNativePresetFactory.a ../libprojectM/Renderer/.libs/libRenderer.a -Wl,--no-whole-archive -lGL -ldl -L/usr/lib/gcc/i686-redhat-linux/9 -L/usr/lib/gcc/i686-redhat-linux/9/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/i686-redhat-linux/9/crtendS.o /usr/lib/gcc/i686-redhat-linux/9/../../../crtn.o -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -O2 -g -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -pthread -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -pthread -pthread -Wl,-soname -Wl,libprojectM.so.3 -o .libs/libprojectM.so.3.1.1
That linker command is just wrong. You just can't use -nostdlib in this way. There is no reference to libgcc, which is implicitly provided without -nostdlib.
I don't know why libtool attempts to link with -nostdlib.
Removing -nostdlib and all references to /usr/lib/gcc/i686-redhat- linux/9/ [2] I also could build libprojectM.so.3.1.1 , but not fixed this error (hidden symbol `__cpu_model' in /usr/lib/gcc/i686-redhat- linux/9/libgcc.a(cpuinfo.o) is referenced by DSO)
I notice -nostdlib is only used one time in all build and its also present on x86_64 and don't cause problems ...
Thanks for the help, any other tip ?
[2] g++ -fPIC -DPIC -shared .libs/ConfigFile.o .libs/Preset.o .libs/PresetLoader.o .libs/timer.o .libs/KeyHandler.o .libs/PresetChooser.o .libs/TimeKeeper.o .libs/PCM.o .libs/PresetFactory.o .libs/fftsg.o .libs/wipemalloc.o .libs/PipelineMerger.o .libs/PresetFactoryManager.o .libs/projectM.o .libs/TestRunner.o -Wl,--whole-archive ../libprojectM/MilkdropPresetFactory/.libs/libMilkdropPresetFactory.a ../libprojectM/NativePresetFactory/.libs/libNativePresetFactory.a ../libprojectM/Renderer/.libs/libRenderer.a -Wl, --no-whole-archive -lGL -ldl -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -O2 -g -fstack-protector- strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat- hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -pthread -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -pthread -pthread -Wl,- soname -Wl,libprojectM.so.3 -o .libs/libprojectM.so.3.1.1
Thanks, Florian
* Sérgio Basto:
On Wed, 2019-03-13 at 10:29 +0100, Florian Weimer wrote:
- Sérgio Basto:
[3] export LDFLAGS="%{?__global_ldflags} -shared"
Not sure why you think this would work. It prevents the compiler from creating any executables at all.
With -shared fixed this generation of binaries [1], it is a tip mention in old thread mention in my previous email, AFAIU.
[1] g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous- unwind-tables -fstack-clash-protection -fcf-protection -pthread -std=c++11 -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o projectM-unittest projectM-unittest.o getConfigFilename.o -pthread -lSDL2 ../libprojectM/.libs/libprojectM.so -lGL -ldl -pthread - D__LIBTOOL_NO_RPATH__ -shared
Oh dear. Thanks. This looks like:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88805
See comment 5 I just posted there.
How urgent is a fix? It looks like this bug has been present for quite some time. It's also present in Fedora 29.
Thanks, Florian
* Florian Weimer:
- Sérgio Basto:
On Wed, 2019-03-13 at 10:29 +0100, Florian Weimer wrote:
- Sérgio Basto:
[3] export LDFLAGS="%{?__global_ldflags} -shared"
Not sure why you think this would work. It prevents the compiler from creating any executables at all.
With -shared fixed this generation of binaries [1], it is a tip mention in old thread mention in my previous email, AFAIU.
[1] g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous- unwind-tables -fstack-clash-protection -fcf-protection -pthread -std=c++11 -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o projectM-unittest projectM-unittest.o getConfigFilename.o -pthread -lSDL2 ../libprojectM/.libs/libprojectM.so -lGL -ldl -pthread - D__LIBTOOL_NO_RPATH__ -shared
Oh dear. Thanks. This looks like:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88805
See comment 5 I just posted there.
It's a Fedora bug after alll. I filed:
https://bugzilla.redhat.com/show_bug.cgi?id=1688766
Thanks, Florian
On Thu, 2019-03-14 at 10:55 +0100, Florian Weimer wrote:
- Sérgio Basto:
On Wed, 2019-03-13 at 10:29 +0100, Florian Weimer wrote:
- Sérgio Basto:
[3] export LDFLAGS="%{?__global_ldflags} -shared"
Not sure why you think this would work. It prevents the compiler from creating any executables at all.
With -shared fixed this generation of binaries [1], it is a tip mention in old thread mention in my previous email, AFAIU.
[1] g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,- D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened- cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous- unwind-tables -fstack-clash-protection -fcf-protection -pthread -std=c++11 -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o projectM-unittest projectM-unittest.o getConfigFilename.o -pthread -lSDL2 ../libprojectM/.libs/libprojectM.so -lGL -ldl -pthread - D__LIBTOOL_NO_RPATH__ -shared
Oh dear. Thanks. This looks like:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88805
See comment 5 I just posted there.
How urgent is a fix? It looks like this bug has been present for quite some time. It's also present in Fedora 29.
Not urgent , I will wait for gcc 9.0.1-0.11 .
Many thanks
Thanks, Florian