openhpi2 / Open-HPI

Open HPI is an open source implementation of the SA Forum's Hardware Platform Interface (HPI). HPI provides an abstracted interface to managing computer hardware, typically for chassis and rack based servers
Other
3 stars 1 forks source link

RPM build error with GCC 4.7.2 #2558

Closed openhpi2 closed 8 years ago

openhpi2 commented 9 years ago

make rpm fails with below error in RHEL7 and gcc version 4.7.2

:1:0: fatal error: stdout: Bad file descriptor compilation terminated. make[3]: **\* [snmp_utils.lo] Error 1 make[3]: Leaving directory `/root/hemanth/Investigation/3.5.x/rpm/BUILD/openhpi-3.5.0/snmp' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory`/root/hemanth/Investigation/3.5.x/rpm/BUILD/openhpi-3.5.0' make[1]: **\* [all] Error 2 make[1]: Leaving directory `/root/hemanth/Investigation/3.5.x/rpm/BUILD/openhpi-3.5.0' error: Bad exit status from /var/tmp/rpm-tmp.sEgoJ4 (%build) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.sEgoJ4 (%build) make: **\* [rpm] Error 1 If with snmp-bc plugin disabled, RPM build generats below different error, strmsock.cpp:1:0: sorry, unimplemented: inter-module optimizations not implemented for C++ make[3]: **\* [strmsock.lo] Error 1 make[3]: Leaving directory `/root/hemanth/Investigation/3.5.x/rpm/BUILD/openhpi-3.5.0/transport' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory`/root/hemanth/Investigation/3.5.x/rpm/BUILD/openhpi-3.5.0' make[1]: **\* [all] Error 2 make[1]: Leaving directory `/root/hemanth/Investigation/3.5.x/rpm/BUILD/openhpi-3.5.0' error: Bad exit status from /var/tmp/rpm-tmp.rxcboe (%build) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.rxcboe (%build) make: **\* [rpm] Error 1 Reported by: hemanthreddy
openhpi2 commented 9 years ago

Diff:


--- old
+++ new
@@ -1,4 +1,4 @@
-make rpm fials with below error in RHEL7 and gcc version 4.7.3
+make rpm fails with below error in RHEL7 and gcc version 4.7.2

 <stdin>:1:0: fatal error: stdout: Bad file descriptor
 compilation terminated.

Original comment by: hemanthreddy

openhpi2 commented 9 years ago

gcc -v

Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --without-ppl --without-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.7.2 20121109 (Red Hat 4.7.2-8) (GCC)

Original comment by: hemanthreddy

openhpi2 commented 9 years ago

Original comment by: dr_mohan

openhpi2 commented 9 years ago

Michele Baldessari sent the following information the issue you're seeing is because on RHEL7 in /usr/lib/rpm/rpmrc there is the following set of CFLAGS: %__global_cflags        -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches %{_hardened_cflags} %{_performance_cflags}

The issue is with "-Wp,-D_FORTIFY_SOURCE=2" because in the spec you do: find . -type f -name "Makefile" | xargs -n1 sed -i -e 's/-D_FORTIFY_SOURCE=2//g;'

And that will leave '-Wp,' which is confusing gcc and making it wait for data on stdin.

I'm not sure why you disable FORTIFY_SOURCE, but either you can fix the sed command to remove -Wp or you leave FORTIFY_SOURCE (and potentially fix any fallouts from it)

Original comment by: dr_mohan

openhpi2 commented 9 years ago

Original comment by: dr_mohan

openhpi2 commented 9 years ago

Fixed with checkin #7604

Original comment by: dr_mohan