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

[BUG] LTO errors on source compilation #1083

Open
LukeKolin opened this issue Sep 28, 2024 · 2 comments
Open

[BUG] LTO errors on source compilation #1083

LukeKolin opened this issue Sep 28, 2024 · 2 comments

Comments

@LukeKolin
Copy link

I am attempting to compile the source tarball and am getting a link error when running make install:

lto1: fatal error: bytecode stream in file ‘threads_mngr.o’ generated with LTO version 6281.0 instead of the expected 6.3

I compile using the following bash script:

`#!/bin/bash

export CC=/usr/bin/gcc
export CX=/usr/bin/g++
export CFLAGS="-march=native -mtune=native -DUSE_PROCESSOR_CLOCK"

nice make USE_SYSTEMD=1`

The initial make succeeds correctly, with the following last few lines...

` CC commands.o
CC strl.o
CC connection.o
CC unix.o
CC logreqres.o
LINK valkey-server
INSTALL valkey-sentinel
CC valkey-cli.o
CC serverassert.o
CC cli_common.o
CC cli_commands.o
LINK valkey-cli
CC valkey-benchmark.o
LINK valkey-benchmark
INSTALL valkey-check-rdb
INSTALL valkey-check-aof

Hint: It's a good idea to run 'make test' ;)

make[1]: Leaving directory '/usr/src/valkey-8.0.0/src'`

When I attempt to execute make install, I get the following:

cd src && make install make[1]: Entering directory '/usr/src/valkey-8.0.0/src' CC Makefile.dep CC release.o LINK valkey-server lto1: fatal error: bytecode stream in file ‘threads_mngr.o’ generated with LTO version 6281.0 instead of the expected 6.3 compilation terminated. lto-wrapper: fatal error: cc returned 1 exit status compilation terminated. /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status make[1]: *** [Makefile:489: valkey-server] Error 1 make[1]: Leaving directory '/usr/src/valkey-8.0.0/src' make: *** [Makefile:9: install] Error 2

I suspect this is to do with my gcc config but at a loss where to start. I have done a 'make distclean' without any effect.

@madolson
Copy link
Member

madolson commented Oct 6, 2024

I haven't seen an issue like this before. Can you try doing make clean && make distclean && make install and see if it works with everything fresh? I wasn't able to reproduce it, and it seems like some weird versioning issue.

@LukeKolin
Copy link
Author

It's really odd. I tried compiling 8.0.1 with GCC 7.5 since it's the standard on OpenSUSE 15.6, and it worked fine.

I then attempted to recompile with GCC 13, with the following instructions:

export CC=/usr/bin/gcc
export CFLAGS="-march=native -mtune=native -DUSE_PROCESSOR_CLOCK"
make clean && make distclean && make install USE_REDIS_SYMLINKS=0 USE_SYSTEMD=1

... and all is well with the world. However, if I try and put an LTO value into CFLAGS (say, -flto=4), then it breaks with an error like above. Not sure if that helps you track things down. I think I am good. I'll try it on an ARM64 instance I have to see if it makes a difference.

Thank you, by the way, for your response. I suspected this was mostly PEBCAK and appreciate your patience.

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

2 participants