Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1518158 - net-snmp-config: --cflags does not include redhat-hardened-cc1 (as required by --agent-libs)
Summary: net-snmp-config: --cflags does not include redhat-hardened-cc1 (as required b...
Keywords:
Status: NEW
Alias: None
Product: Fedora Container Images
Classification: Fedora
Component: toolchain
Version: rawhide
Hardware: s390x
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Honza Horak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-28 10:50 UTC by IBM Bug Proxy
Modified: 2018-01-08 14:00 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
IBM Linux Technology Center 161667 None None None 2017-11-28 10:50:53 UTC

Description IBM Bug Proxy 2017-11-28 10:50:37 UTC

Comment 1 IBM Bug Proxy 2017-11-28 10:50:51 UTC
== Comment: #0 - Hendrik Brueckner <brueckner@de.ibm.com> - 2017-11-24 00:48:36 ==
On s390x, build errors are encountered when building net-snmp agents:

 /usr/bin/ld: osasnmpd.o: `getopt_long@@GLIBC_2.2' non-PLT reloc for symbol
              defined in shared library and accessed from executable
              (rebuild file with -fPIC ?)
 /usr/bin/ld: final link failed: Bad value


The problem is:

[root@name ~]# net-snmp-config --agent-libs
 -Wl,-z,relro -Wl,-z,now -L/usr/lib64 -lnetsnmpmibs -ldl -lrpm -lrpmio -lnetsnmpagent -lwrap -Wl,--enable-new-dtags -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -lnetsnmp -lssl -lssl -lcrypto -lm

[root@name ~]# net-snmp-config --cflags
 -I. -I/usr/include

The --cflags output shall include -specs=/rpm/redhat/redhat-hardened-cc1 that ensures to build objects with -fPIC.

Please note that object files on s390 should always be build with -fPIC to be used for PIE variables or shared objects.


Affects: s390-tools

== Comment: #2 - Jonathan Hermann <jonathan.hermann@de.ibm.com> - 2017-11-27 04:49:36 ==
net-snmp-devel package used for build is version 5.7.3-25.fc27.s390x

Comment 2 karlp 2018-01-08 14:00:44 UTC
Seems to be missing the dependency (rightly or wrongly) on redhat-rpm-config?

Getting the same problems with a user agent application using builds flags as
NETSNMPCFLAGS := $(shell net-snmp-config --base-cflags)
NETSNMPLIBS := $(shell net-snmp-config --agent-libs)

$ net-snmp-config --agent-libs
-Wl,-z,relro -Wl,-z,now -L/usr/lib64 -lnetsnmpmibs -lsensors -ldl -lrpm -lrpmio -lnetsnmpagent -lwrap -Wl,--enable-new-dtags -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -lnetsnmp -lssl -lssl -lcrypto -lm

which leads to 

cc: error: /usr/lib/rpm/redhat/redhat-hardened-ld: No such file or directory


However, even installing that package gives me the above errors as on s390

/usr/bin/ld: mypersonalapp.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

This is all stuff that compiled fine on fedora 22 at least.


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