Summary: | net-proxy/dante-1.4.1-r6 fails to compile (lto): sockd.c:1234:27: error: type of module_redirect_keyv does not match original declaration [-Werror=lto-type-mismatch] | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Agostino Sarubbo <ago> |
Component: | Current packages | Assignee: | Robin Johnson <robbat2> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | eschwartz, jetdog330 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | Yes | |
Bug Depends on: | |||
Bug Blocks: | 618550 | ||
Attachments: |
build.log
Proposed fix for dante-1.4.3 lto type mismatch |
Description
Agostino Sarubbo
![]() Created attachment 795377 [details]
build.log
build log and emerge --info
Please retest against dante-1.4.3 due to major changes upstream & in the patch-set. There were originally 3 different instances of the lto-type-mismatch error. And 1 of them has gone away, but the other 2 remain: libtool: link: x86_64-pc-linux-gnu-gcc -DSOCKS_SERVER=1 -DSOCKS_CLIENT=0 -DSOCKSLIBRARY_DYNAMIC=1 -DSTANDALONE_UNIT_TEST=0 -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -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 -g -O2 -ggdb -pipe -Wl,-O1 -Wl,-z -Wl,pack-relative-relocs -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 -o sockd addressmatch.o authneg.o broken.o clientprotocol.o config.o config_parse.o config_scan.o debug.o errorsymbols.o fmt.o fmt_customer.o fmt_protocol.o gssapi.o hostcache.o hostid.o httpproxy.o hw.o iface.o io.o iobuf.o ipv6.o krb5.o log.o method.o parse_util.o protocol.o serr.o showconfig.o sockaddr.o socket.o socketopt.o sockopt.o tcpinfo.o time.o tostring.o udp_util.o upnp.o userio.o util.o in_cksum.o accesscheck.o auth_bsd.o auth_pam.o auth_password.o bandwidth.o bandwidth_key.o checkmodule.o cpu.o cpuaffinity.o cpupolicy.o dante_udp.o fmt_sockd.o getoutaddr.o ldap.o ldap_key.o ldap_util.o math.o method_gssapi.o method_uname.o monitor.o monitor_util.o mother_util.o pac.o pac_key.o privileges.o redirect.o redirect_key.o rule.o serverconfig.o session.o shmem.o shmemconfig.o sockd.o sockd_child.o sockd_icmp.o sockd_io.o sockd_io_misc.o sockd_negotiate.o sockd_protocol.o sockd_request.o sockd_socket.o sockd_tcp.o sockd_udp.o sockd_util.o statistics.o udp_port.o interposition.o setproctitle.o strvis.o -Wl,--as-needed -lm -lpam -lcrypt sockd.c:1261:27: error: type of 'module_redirect_keyv' does not match original declaration [-Werror=lto-type-mismatch] 1261 | extern const licensekey_t module_redirect_keyv[]; | ^ redirect_key.c:13:21: note: 'module_redirect_keyv' was previously declared here 13 | const licensekey_t *module_redirect_keyv = NULL; | ^ redirect_key.c:13:21: note: code may be misoptimized unless '-fno-strict-aliasing' is used sockd.c:1265:27: error: type of 'module_bandwidth_keyv' does not match original declaration [-Werror=lto-type-mismatch] 1265 | extern const licensekey_t module_bandwidth_keyv[]; | ^ bandwidth_key.c:13:21: note: 'module_bandwidth_keyv' was previously declared here 13 | const licensekey_t *module_bandwidth_keyv = NULL; | ^ bandwidth_key.c:13:21: note: code may be misoptimized unless '-fno-strict-aliasing' is used 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[1]: *** [Makefile:578: sockd] Error 1 Created attachment 913483 [details, diff]
Proposed fix for dante-1.4.3 lto type mismatch
Managed to create a patch for dante-1.4.3 while attempting my first "system-wide LTO".
Tested with: CFLAGS += "-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing".
Bug was pretty simple, they were referencing an extern array in one translation unit, and declaring a pointer in the other. 2 instance of this appear by default, and 3rd appears to be possible if you compile with LDAP enabled, which I fix in the patch too.
|