Description of problem: When using swipl-ld to compile C+Prolog, compilation fails with error: swipl-ld error: unrecognized command line option '-mtu' this does not occur in Fedora 22. Version-Release number of selected component (if applicable): pl-7.2.3-1.fc23.x86_64 How reproducible: Steps to Reproduce: 1. Use swipl-ld to compile a C + Prolog executable Actual results: [makerpm@9d7a7e7ec9d3 prolog]$ swipl-ld -Lm -goal true -initfile swi-logol.pl -o preanalyse.exe -v preSwiMain.c sicstus.pl logol.pl eval `swipl --dump-runtime-variables` CC="gcc" PLBASE="/usr/lib64/swipl-7.2.3" PLARCH="x86_64-linux" PLLIBS="" PLLIB="-lswipl" PLCFLAGS="-fno-strict-aliasing -pthread -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtu" PLLDFLAGS="-rdynamic -Wl,--enable-new-dtags -pthread -Wl,-rpath=/usr/lib64/swipl-7.2.3/lib/x86_64-linux" PLSOEXT="so" PLTHREADS="yes" gcc -c -fno-strict-aliasing -pthread -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtu -D_REENTRANT -D__SWI_PROLOG__ -D__SWI_EMBEDDED__ -I/usr/lib64/swipl-7.2.3/include -o preSwiMain.o preSwiMain.c cc1: error: unrecognized command line option '-mtu' I did not find any clue on "-mtu" and don't find a way to disable/override it. This seems to be introduced by package itself with flags used at pl package build. Expected results: exe generation Additional info: I talked with upstream author and here is what he said "I don't really understand what is going on. PLCFLAGS is initialized from the Prolog flag `c_cflags`, which is in turn set during the build process from the CFLAGS used. No clue what -mtu means (see manual), but I'd assume if they use a particular set of flags for compiling the packages you can use the same flags for compiling your own applications ... Apparently this assumption is wrong!?"
I confirm swipl-ld produces invalid -mtu CC flag. It looks like something truncates the PLCFLAGS value. On the other hand, it worked on 2015-08-27. I found a compiled test on my machine.
I think I found it. It's a bug in SWI swipl-ld. The src/swipl-ld.c parses "swipl --dump-runtime-variables" output. It segments lines into 256-byte long buffer. And fgets(3) hits the 256-byte limit on PLCFLAGS value: Fedora 22: $ swipl --dump-runtime-variables | grep PLCFLAGS | wc -c 222 Fedora 23: $ swipl --dump-runtime-variables | grep PLCFLAGS | wc -c 268
ok, upstream pushed a fix, thanks for analysis Waiting for new release... :-)
I will try the fix and if everything is fine, I will push the fixed build into Fedora. Thanks for alerting the upstream.
pl-7.2.3-3.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-12fe2d64e1
pl-7.2.3-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-b55cb4ee46
pl-7.2.3-3.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-12fe2d64e1
pl-7.2.3-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-b55cb4ee46
Tested fix on Fedora 23 from testing branch and it works fine
pl-7.2.3-3.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
pl-7.2.3-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.