Bug 1326581 - swipl-ld error: unrecognized command line option '-mtu'
Summary: swipl-ld error: unrecognized command line option '-mtu'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pl
Version: 23
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL: https://groups.google.com/forum/embed...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-13 07:27 UTC by osallou
Modified: 2016-04-22 01:22 UTC (History)
3 users (show)

Fixed In Version: pl-7.2.3-3.fc25 pl-7.2.3-3.fc24 pl-7.2.3-2.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-18 17:26:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description osallou 2016-04-13 07:27:04 UTC
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!?"

Comment 1 Petr Pisar 2016-04-13 10:29:11 UTC
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.

Comment 2 Petr Pisar 2016-04-13 10:56:32 UTC
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

Comment 3 osallou 2016-04-13 11:40:22 UTC
ok, upstream pushed a fix, thanks for analysis

Waiting for new release... :-)

Comment 4 Petr Pisar 2016-04-13 12:13:39 UTC
I will try the fix and if everything is fine, I will push the fixed build into Fedora. Thanks for alerting the upstream.

Comment 5 Fedora Update System 2016-04-13 12:50:14 UTC
pl-7.2.3-3.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-12fe2d64e1

Comment 6 Fedora Update System 2016-04-13 12:50:32 UTC
pl-7.2.3-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-b55cb4ee46

Comment 7 Fedora Update System 2016-04-13 21:23:26 UTC
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

Comment 8 Fedora Update System 2016-04-14 04:52:17 UTC
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

Comment 9 osallou 2016-04-14 07:43:56 UTC
Tested fix on Fedora 23 from testing branch and it works fine

Comment 10 Fedora Update System 2016-04-18 17:26:26 UTC
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.

Comment 11 Fedora Update System 2016-04-22 01:22:29 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.