Bug 1540240

Summary: eclipse-cdt: RPM build flags not used consistently
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: eclipse-cdtAssignee: Jeff Johnston <jjohnstn>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: akurtako, fweimer, jjohnstn, krzysztof.daniel, mat.booth, rgrunber, TicoTimo
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: eclipse-cdt-9.4.1-0.4 eclipse-cdt-9.4.1-0.3.fc27 eclipse-cdt-9.4.1-0.3.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-06 15:32:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1539083    

Description Florian Weimer 2018-01-30 15:10:27 UTC
Parts of eclipse-cdt-9.3.2-4.fc28 are built with the proper build flags, e.g. here the usual flags are missing:

[INFO] --- maven-antrun-plugin:1.8:run (natives) @ org.eclipse.cdt.core.linux ---
[INFO] Executing tasks
main:
     [exec] gcc -fpic -D_REENTRANT -D_GNU_SOURCE -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux  -c -o spawner.o spawner.c
     [exec] gcc -fpic -D_REENTRANT -D_GNU_SOURCE -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux  -c -o io.o io.c
     [exec] gcc -fpic -D_REENTRANT -D_GNU_SOURCE -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux  -c -o exec_unix.o exec_unix.c
     [exec] gcc -fpic -D_REENTRANT -D_GNU_SOURCE -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux  -c -o exec_pty.o exec_pty.c
     [exec] gcc -fpic -D_REENTRANT -D_GNU_SOURCE -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux  -c -o pfind.o pfind.c
     [exec] gcc -fpic -D_REENTRANT -D_GNU_SOURCE -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux  -c -o openpty.o openpty.c
     [exec] mkdir -p ../../org.eclipse.cdt.core.linux.x86_64/os/linux/x86_64
     [exec] gcc -g -shared -Wl,-soname,libspawner.so  -o ../../org.eclipse.cdt.core.linux.x86_64/os/linux/x86_64/libspawner.so spawner.o io.o exec_unix.o exec_pty.o pfind.o openpty.o -lc
     [exec] gcc -fpic -D_REENTRANT -D_GNU_SOURCE -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux  -c -o pty.o pty.c
     [exec] gcc -fpic -D_REENTRANT -D_GNU_SOURCE -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux  -c -o ptyio.o ptyio.c
     [exec] mkdir -p ../../org.eclipse.cdt.core.linux.x86_64/os/linux/x86_64
     [exec] gcc -g -shared -Wl,-soname,libpty.so  -o ../../org.eclipse.cdt.core.linux.x86_64/os/linux/x86_64/libpty.so openpty.o pty.o ptyio.o

Other parts are built with the correct CFLAGS/LDFLAGS settings coming from redhat-rpm-config.

Comment 1 Fedora Update System 2018-01-31 16:34:35 UTC
eclipse-cdt-9.4.1-0.3.fc27 eclipse-launchbar-2.2.0-1.fc27 eclipse-linuxtools-6.2.0-2.fc27 docker-client-java-6.2.5-6.fc27 jackson-module-jaxb-annotations-2.7.6-4.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-ed6a2f1dd3

Comment 2 Fedora Update System 2018-01-31 16:34:47 UTC
eclipse-cdt-9.4.1-0.3.fc26 eclipse-launchbar-2.2.0-1.fc26 eclipse-linuxtools-6.2.0-2.fc26 docker-client-6.2.5-3.fc26 jackson-module-jaxb-annotations-2.7.6-4.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-11c125e473

Comment 3 Fedora Update System 2018-01-31 18:44:00 UTC
docker-client-6.2.5-3.fc26, eclipse-cdt-9.4.1-0.3.fc26, eclipse-launchbar-2.2.0-1.fc26, eclipse-linuxtools-6.2.0-2.fc26, jackson-module-jaxb-annotations-2.7.6-4.fc26 has been pushed to the Fedora 26 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-2018-11c125e473

Comment 4 Fedora Update System 2018-01-31 22:46:49 UTC
docker-client-java-6.2.5-6.fc27, eclipse-cdt-9.4.1-0.3.fc27, eclipse-launchbar-2.2.0-1.fc27, eclipse-linuxtools-6.2.0-2.fc27, jackson-module-jaxb-annotations-2.7.6-4.fc27 has been pushed to the Fedora 27 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-2018-ed6a2f1dd3

Comment 5 Florian Weimer 2018-02-01 08:00:11 UTC
In eclipse-cdt-9.4.1-0.3.fc28, CFLAGS are injected, but LDFLAGS are still missing, e.g.:

gcc -fPIC -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 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -shared -o ../os/linux/x86_64/libserial.so serial.c

     [exec] gcc -g -shared -Wl,-soname,libpty.so  -o ../../org.eclipse.cdt.core.linux.x86_64/os/linux/x86_64/libpty.so openpty.o pty.o ptyio.o

There's no reference to -Wl,-z,relro or hardened-ld, which would be there if LDFLAGS injection worked.

Comment 6 Mat Booth 2018-02-01 09:55:50 UTC
Okay, now should be injecting LDFLAGS also: https://koji.fedoraproject.org/koji/buildinfo?buildID=1022892

Do you know if there is a convenient macro for LDFLAGS, like there is %{optflags} for CFLAGS?

Comment 7 Florian Weimer 2018-02-01 10:00:02 UTC
(In reply to Mat Booth from comment #6)
> Okay, now should be injecting LDFLAGS also:
> https://koji.fedoraproject.org/koji/buildinfo?buildID=1022892
> 
> Do you know if there is a convenient macro for LDFLAGS, like there is
> %{optflags} for CFLAGS?

We are working on providing clearer guidelines as part of bug 1525568.

Today, you can use the shell variable RPM_LD_FLAGS.  It will be supported in future versions of redhat-rpm-config, too.

Comment 8 Mat Booth 2018-02-01 10:14:42 UTC
(In reply to Florian Weimer from comment #7)
> (In reply to Mat Booth from comment #6)
> > Okay, now should be injecting LDFLAGS also:
> > https://koji.fedoraproject.org/koji/buildinfo?buildID=1022892
> > 
> > Do you know if there is a convenient macro for LDFLAGS, like there is
> > %{optflags} for CFLAGS?
> 
> We are working on providing clearer guidelines as part of bug 1525568.
> 
> Today, you can use the shell variable RPM_LD_FLAGS.  It will be supported in
> future versions of redhat-rpm-config, too.

Awesome, thanks

Comment 9 Fedora Update System 2018-02-06 15:32:40 UTC
docker-client-java-6.2.5-6.fc27, eclipse-cdt-9.4.1-0.3.fc27, eclipse-launchbar-2.2.0-1.fc27, eclipse-linuxtools-6.2.0-2.fc27, jackson-module-jaxb-annotations-2.7.6-4.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2018-02-08 09:26:07 UTC
docker-client-6.2.5-3.fc26, eclipse-cdt-9.4.1-0.3.fc26, eclipse-launchbar-2.2.0-1.fc26, eclipse-linuxtools-6.2.0-2.fc26, jackson-module-jaxb-annotations-2.7.6-4.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.