Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to compile with LTO enabled #47

Open
eli-schwartz opened this issue Feb 7, 2024 · 0 comments
Open

Fails to compile with LTO enabled #47

eli-schwartz opened this issue Feb 7, 2024 · 0 comments

Comments

@eli-schwartz
Copy link

I tried building gpm from git with -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing in CFLAGS / LDFLAGS. It failed to build with the following error:

gcc  -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 -L/tmp/gpm/src  -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -o gpm mice.o twiddler.o synaptics.o daemon/add_mouse.o daemon/init_mice.o daemon/reset_mice.o daemon/build_argv.o daemon/disable_paste.o daemon/do_client.o daemon/do_selection.o daemon/get_console_size.o daemon/get_data.o daemon/getmousedata.o daemon/gpm.o daemon/gpm-killed.o daemon/header.o daemon/main.o daemon/old_main.o daemon/open_console.o daemon/check_kill.o daemon/gpm_exited.o generic/isodigit.o generic/getsym.o daemon/processspecial.o daemon/processconn.o daemon/processmouse.o daemon/processrequest.o daemon/selection_copy.o daemon/selection_paste.o daemon/cmdline.o daemon/loadlut.o daemon/find_mouse_by_name.o daemon/usage.o daemon/check_uniqueness.o daemon/startup.o daemon/wait_text.o report.o tools.o   -lm
/tmp/gpm/src/headers/daemon.h:175:25: error: type of ‘cinfo’ does not match original declaration [-Werror=lto-type-mismatch]
  175 | extern Gpm_Cinfo       *cinfo[MAX_VC+1];
      |                         ^
daemon/gpm.c:96:12: note: array types have different bounds
   96 | Gpm_Cinfo *cinfo[MAX_VC+1];
      |            ^
daemon/gpm.c:96:12: note: ‘cinfo’ was previously declared here
lto1: some warnings being treated as errors
lto-wrapper: fatal error: 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:85: gpm] Error 1

See also: https://bugs.gentoo.org/885323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant