Skip to content

Build fails with -flto #40

@eli-schwartz

Description

@eli-schwartz

Log excerpt:

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 -Wformat -Werror=format-security -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -Wall -I../../drbd-headers -I.. -I. -I../shared   -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0  -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -o drbdadm drbdadm_scanner.o drbdadm_parser.o drbdadm_postparse.o drbdadm_main.o drbdadm_adjust.o drbdadm_dump.o drbdtool_common.o drbdadm_usage_cnt.o drbd_buildtag.o registry.o config_flags.o libnla.o drbd_nla.o shared_tool.o shared_main.o shared_parser.o libgenl.o drbdadm_linux.o drbdtool_common_linux.o path_linux.o shared_linux.o
../shared/shared_main.c:60:22: error: type of ‘ifreq_list’ does not match original declaration [-Werror=lto-type-mismatch]
   60 | extern struct ifreq *ifreq_list;
      |                      ^
drbdadm_main.c:150:15: note: ‘ifreq_list’ was previously declared here
  150 | struct ifreq *ifreq_list = NULL;
      |               ^
drbdadm_main.c:150:15: 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/libexec/gcc/x86_64-pc-linux-gnu/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:111: drbdadm] Error 1

Full build log:
drbd-utils-9.25.0:20231231-225010.log

Downstream bug report: https://bugs.gentoo.org/863728

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions