arcress0 / ipmiutil

ipmiutil is an easy to use set of IPMI server management utilities. It can get/set sensor readings & thresholds, automate SEL management, do SOL console, etc. Supports Linux, Windows, BSD, Solaris, MacOSX. The only IPMI project tool that runs natively on Windows. See http://ipmiutil.sf.net for rpms, etc. (formerly called panicsel). It can run driverless in Linux for use on boot media or embedded environments.
BSD 3-Clause "New" or "Revised" License
33 stars 5 forks source link

Build fails with LTO #21

Open eli-schwartz opened 6 months ago

eli-schwartz commented 6 months ago
x86_64-pc-linux-gnu-gcc  -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -o iseltime iseltime.o libipmiutil.a -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0  -lpthread  ../lib/libipmi_lanplus.a -lcrypto 
x86_64-pc-linux-gnu-gcc -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -o ipmi_sample ipmi_sample.o libipmiutil.a -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0  ../lib/libipmi_lanplus.a -lcrypto
ipmicmd.c:197:12: error: type of ‘ipmi_cmdraw_ia’ does not match original declaration [-Werror=lto-type-mismatch]
  197 | extern int ipmi_cmdraw_ia( uchar cmd, uchar netfn, uchar lun, uchar sa,
      |            ^
imbapi.c:863:5: note: type mismatch in parameter 7
  863 | int ipmi_cmdraw_ia(BYTE cmd, BYTE netfn, BYTE lun, BYTE sa, BYTE bus,
      |     ^
imbapi.c:863:5: note: type ‘BYTE’ should match type ‘int’
imbapi.c:863:5: note: ‘ipmi_cmdraw_ia’ was previously declared here
ipmicmd.c:216:12: error: type of ‘ipmi_open_direct’ does not match original declaration [-Werror=lto-type-mismatch]
  216 | extern int ipmi_open_direct(char fdebug);
      |            ^
ipmidir.c:392:5: note: type mismatch in parameter 1
  392 | int ipmi_open_direct(int fdebugcmd)
      |     ^
ipmidir.c:392:5: note: type ‘int’ should match type ‘char’
ipmidir.c:392:5: note: ‘ipmi_open_direct’ was previously declared here
ipmicmd.c:197:12: error: type of ‘ipmi_cmdraw_ia’ does not match original declaration [-Werror=lto-type-mismatch]
  197 | extern int ipmi_cmdraw_ia( uchar cmd, uchar netfn, uchar lun, uchar sa,
      |            ^
imbapi.c:863:5: note: type mismatch in parameter 7
  863 | int ipmi_cmdraw_ia(BYTE cmd, BYTE netfn, BYTE lun, BYTE sa, BYTE bus,
      |     ^
imbapi.c:863:5: note: type ‘BYTE’ should match type ‘int’
imbapi.c:863:5: note: ‘ipmi_cmdraw_ia’ was previously declared here
ipmicmd.c:216:12: error: type of ‘ipmi_open_direct’ does not match original declaration [-Werror=lto-type-mismatch]
  216 | extern int ipmi_open_direct(char fdebug);
      |            ^
ipmidir.c:392:5: note: type mismatch in parameter 1
  392 | int ipmi_open_direct(int fdebugcmd)
      |     ^
ipmidir.c:392:5: note: type ‘int’ should match type ‘char’
ipmidir.c:392:5: note: ‘ipmi_open_direct’ was previously declared here
itsol.h:61:5: error: type of ‘open_sockfd’ does not match original declaration [-Werror=lto-type-mismatch]
   61 | int open_sockfd(char *node, SockType *sfd, SOCKADDR_T  *daddr,
      |     ^
ipmilan.c:531:5: note: type mismatch in parameter 2
  531 | int open_sockfd(char *node, int port, SockType *sfd, SOCKADDR_T  *daddr,
      |     ^
ipmilan.c:531:5: note: ‘open_sockfd’ was previously declared here
ipmilan.c:531:5: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
isol.c:145:13: error: type of ‘lan_keepalive’ does not match original declaration [-Werror=lto-type-mismatch]
  145 | extern int  lan_keepalive(int type);
      |             ^
ipmilan.c:2218:6: note: type mismatch in parameter 1
 2218 | int  lan_keepalive( uchar bType )
      |      ^
ipmilan.c:2218:6: note: type ‘unsigned char’ should match type ‘int’
ipmilan.c:2218:6: note: ‘lan_keepalive’ was previously declared here
ievents.c:629:12: error: type of ‘GetSensorType’ does not match original declaration [-Werror=lto-type-mismatch]
  629 | extern int GetSensorType(int snum, uchar *stype, uchar *rtype);
      |            ^
isensor.c:1111:5: note: type mismatch in parameter 1
 1111 | int GetSensorType(uchar snum, uchar *stype, uchar *rtype)
      |     ^
isensor.c:1111:5: note: type ‘unsigned char’ should match type ‘int’
isensor.c:1111:5: note: ‘GetSensorType’ was previously declared here
ievents.c:627:14: error: type of ‘get_unit_type’ does not match original declaration [-Werror=lto-type-mismatch]
  627 | extern char *get_unit_type(uchar iunit, uchar ibase, uchar imod, int flg);
      |              ^
isensor.c:628:7: note: type mismatch in parameter 1
  628 | char *get_unit_type(int iunits, int ibase, int imod, int fshort)
      |       ^
isensor.c:628:7: note: type ‘int’ should match type ‘unsigned char’
isensor.c:628:7: note: ‘get_unit_type’ was previously declared here
ievents.c:784:13: error: type of ‘get_MemDesc’ does not match original declaration [-Werror=lto-type-mismatch]
  784 | extern int  get_MemDesc(int array, int dimm, char *desc, int *psz); /*mem_if.c*/
      |             ^
mem_if.c:617:5: note: type mismatch in parameter 1
  617 | int get_MemDesc(UCHAR array, UCHAR dimm, char *desc, int *psize)
      |     ^
mem_if.c:617:5: note: type ‘UCHAR’ should match type ‘int’
mem_if.c:617:5: note: ‘get_MemDesc’ was previously declared here
make: TMPDIR value /tmp/iu/ipmiutil-3.1.9: No such file or directory
make: using default temporary directory '/tmp'
make: TMPDIR value /tmp/iu/ipmiutil-3.1.9: No such file or directory
make: using default temporary directory '/tmp'
lto1: some warnings being treated as errors
lto-wrapper: fatal error: x86_64-pc-linux-gnu-gcc returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:1033: libipmiutil.so.1] Error 1
make[2]: *** Waiting for unfinished jobs....
ipmicmd.c:197:12: error: type of ‘ipmi_cmdraw_ia’ does not match original declaration [-Werror=lto-type-mismatch]
  197 | extern int ipmi_cmdraw_ia( uchar cmd, uchar netfn, uchar lun, uchar sa,
      |            ^
imbapi.c:863:5: note: type mismatch in parameter 7
  863 | int ipmi_cmdraw_ia(BYTE cmd, BYTE netfn, BYTE lun, BYTE sa, BYTE bus,
      |     ^
imbapi.c:863:5: note: type ‘BYTE’ should match type ‘int’
imbapi.c:863:5: note: ‘ipmi_cmdraw_ia’ was previously declared here
ipmicmd.c:216:12: error: type of ‘ipmi_open_direct’ does not match original declaration [-Werror=lto-type-mismatch]
  216 | extern int ipmi_open_direct(char fdebug);
      |            ^
ipmidir.c:392:5: note: type mismatch in parameter 1
  392 | int ipmi_open_direct(int fdebugcmd)
      |     ^
ipmidir.c:392:5: note: type ‘int’ should match type ‘char’
ipmidir.c:392:5: note: ‘ipmi_open_direct’ was previously declared here
ipmicmd.c:197:12: error: type of ‘ipmi_cmdraw_ia’ does not match original declaration [-Werror=lto-type-mismatch]
  197 | extern int ipmi_cmdraw_ia( uchar cmd, uchar netfn, uchar lun, uchar sa,
      |            ^
imbapi.c:863:5: note: type mismatch in parameter 7
  863 | int ipmi_cmdraw_ia(BYTE cmd, BYTE netfn, BYTE lun, BYTE sa, BYTE bus,
      |     ^
imbapi.c:863:5: note: type ‘BYTE’ should match type ‘int’
imbapi.c:863:5: note: ‘ipmi_cmdraw_ia’ was previously declared here
ipmicmd.c:216:12: error: type of ‘ipmi_open_direct’ does not match original declaration [-Werror=lto-type-mismatch]
  216 | extern int ipmi_open_direct(char fdebug);
      |            ^
ipmidir.c:392:5: note: type mismatch in parameter 1
  392 | int ipmi_open_direct(int fdebugcmd)
      |     ^
ipmidir.c:392:5: note: type ‘int’ should match type ‘char’
ipmidir.c:392:5: note: ‘ipmi_open_direct’ was previously declared here
lto1: some warnings being treated as errors
lto-wrapper: fatal error: x86_64-pc-linux-gnu-gcc returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:1106: iseltime] Error 1
lto1: some warnings being treated as errors
lto-wrapper: fatal error: x86_64-pc-linux-gnu-gcc returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Exhaustive build log: build.log Downstream report: https://bugs.gentoo.org/863590

arcress0 commented 6 months ago

This is odd. Apparently the typedef of BYTE as unsigned char is not included in certain cases, I'll address this in the upcoming ipmiutil release.