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

Build fails with LTO #2023

Closed
eli-schwartz opened this issue Mar 7, 2024 · 3 comments
Closed

Build fails with LTO #2023

eli-schwartz opened this issue Mar 7, 2024 · 3 comments
Assignees

Comments

@eli-schwartz
Copy link

eli-schwartz commented Mar 7, 2024

I tried to build with these flags: -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing

Note: the -Werror=* are important since they indicate cases where the compiler can try to optimize by assuming UB cannot exist, and if it does exist then the result is incorrectly compiled code.

I got this error when building the tests:

[1/4] : && /usr/bin/x86_64-pc-linux-gnu-g++ -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  -O1 -Wa,--noexecstack  -Wall -Wextra -Wno-format-truncation -g -DHAVE_MREMAP -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0  -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now     -rdynamic integs/CMakeFiles/TestClientQueries.dir/TestClientQueries.cpp.o integs/CMakeFiles/TestClientQueries.dir/DriverMock.cpp.o integs/CMakeFiles/TestClientQueries.dir/ConnectionMock.cpp.o integs/CMakeFiles/TestClientQueries.dir/ProcessController.cpp.o integs/CMakeFiles/TestClientQueries.dir/IndiClientMock.cpp.o integs/CMakeFiles/TestClientQueries.dir/IndiServerController.cpp.o integs/CMakeFiles/TestClientQueries.dir/utils.cpp.o integs/CMakeFiles/TestClientQueries.dir/XmlAwaiter.cpp.o integs/CMakeFiles/TestClientQueries.dir/SharedBuffer.cpp.o integs/CMakeFiles/TestClientQueries.dir/ServerMock.cpp.o -o integs/TestClientQueries  /usr/lib64/libgtest_main.so.1.13.0  /usr/lib64/libgtest.so.1.13.0 && cd /var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs && /usr/bin/cmake -D TEST_TARGET=TestClientQueries -D TEST_EXECUTABLE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestClientQueries -D TEST_EXECUTOR= -D TEST_WORKING_DIR=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs -D TEST_EXTRA_ARGS= -D "TEST_PROPERTIES=TIMEOUT;5" -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=TestClientQueries_TESTS -D CTEST_FILE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestClientQueries[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P /usr/share/cmake/Modules/GoogleTestAddTests.cmake
FAILED: integs/TestClientQueries integs/TestClientQueries[1]_tests.cmake /var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestClientQueries[1]_tests.cmake 
: && /usr/bin/x86_64-pc-linux-gnu-g++ -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  -O1 -Wa,--noexecstack  -Wall -Wextra -Wno-format-truncation -g -DHAVE_MREMAP -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0  -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now     -rdynamic integs/CMakeFiles/TestClientQueries.dir/TestClientQueries.cpp.o integs/CMakeFiles/TestClientQueries.dir/DriverMock.cpp.o integs/CMakeFiles/TestClientQueries.dir/ConnectionMock.cpp.o integs/CMakeFiles/TestClientQueries.dir/ProcessController.cpp.o integs/CMakeFiles/TestClientQueries.dir/IndiClientMock.cpp.o integs/CMakeFiles/TestClientQueries.dir/IndiServerController.cpp.o integs/CMakeFiles/TestClientQueries.dir/utils.cpp.o integs/CMakeFiles/TestClientQueries.dir/XmlAwaiter.cpp.o integs/CMakeFiles/TestClientQueries.dir/SharedBuffer.cpp.o integs/CMakeFiles/TestClientQueries.dir/ServerMock.cpp.o -o integs/TestClientQueries  /usr/lib64/libgtest_main.so.1.13.0  /usr/lib64/libgtest.so.1.13.0 && cd /var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs && /usr/bin/cmake -D TEST_TARGET=TestClientQueries -D TEST_EXECUTABLE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestClientQueries -D TEST_EXECUTOR= -D TEST_WORKING_DIR=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs -D TEST_EXTRA_ARGS= -D "TEST_PROPERTIES=TIMEOUT;5" -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=TestClientQueries_TESTS -D CTEST_FILE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestClientQueries[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P /usr/share/cmake/Modules/GoogleTestAddTests.cmake
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/ConnectionMock.cpp:228:6: error: type ‘XmlStatus’ violates the C++ One Definition Rule [-Werror=odr]
  228 | enum XmlStatus { PRE, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |      ^
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/XmlAwaiter.cpp:22:6: note: an enum with different value name is defined in another translation unit
   22 | enum XmlStatus { PRE, WAIT_TAGNAME, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |      ^
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/ConnectionMock.cpp:228:23: note: name ‘TAGNAME’ differs from name ‘WAIT_TAGNAME’ defined in another translation unit
  228 | enum XmlStatus { PRE, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |                       ^
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/XmlAwaiter.cpp:22:23: note: mismatching definition
   22 | enum XmlStatus { PRE, WAIT_TAGNAME, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |                       ^
lto1: some warnings being treated as errors
lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ 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
[2/4] : && /usr/bin/x86_64-pc-linux-gnu-g++ -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  -O1 -Wa,--noexecstack  -Wall -Wextra -Wno-format-truncation -g -DHAVE_MREMAP -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0  -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now     -rdynamic integs/CMakeFiles/TestIndiSetProp.dir/TestIndiSetProp.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/DriverMock.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/ConnectionMock.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/ProcessController.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/IndiClientMock.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/IndiServerController.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/utils.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/XmlAwaiter.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/SharedBuffer.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/ServerMock.cpp.o -o integs/TestIndiSetProp  /usr/lib64/libgtest_main.so.1.13.0  /usr/lib64/libgtest.so.1.13.0 && cd /var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs && /usr/bin/cmake -D TEST_TARGET=TestIndiSetProp -D TEST_EXECUTABLE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiSetProp -D TEST_EXECUTOR= -D TEST_WORKING_DIR=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs -D TEST_EXTRA_ARGS= -D "TEST_PROPERTIES=TIMEOUT;10" -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=TestIndiSetProp_TESTS -D CTEST_FILE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiSetProp[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P /usr/share/cmake/Modules/GoogleTestAddTests.cmake
FAILED: integs/TestIndiSetProp integs/TestIndiSetProp[1]_tests.cmake /var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiSetProp[1]_tests.cmake 
: && /usr/bin/x86_64-pc-linux-gnu-g++ -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  -O1 -Wa,--noexecstack  -Wall -Wextra -Wno-format-truncation -g -DHAVE_MREMAP -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0  -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now     -rdynamic integs/CMakeFiles/TestIndiSetProp.dir/TestIndiSetProp.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/DriverMock.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/ConnectionMock.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/ProcessController.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/IndiClientMock.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/IndiServerController.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/utils.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/XmlAwaiter.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/SharedBuffer.cpp.o integs/CMakeFiles/TestIndiSetProp.dir/ServerMock.cpp.o -o integs/TestIndiSetProp  /usr/lib64/libgtest_main.so.1.13.0  /usr/lib64/libgtest.so.1.13.0 && cd /var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs && /usr/bin/cmake -D TEST_TARGET=TestIndiSetProp -D TEST_EXECUTABLE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiSetProp -D TEST_EXECUTOR= -D TEST_WORKING_DIR=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs -D TEST_EXTRA_ARGS= -D "TEST_PROPERTIES=TIMEOUT;10" -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=TestIndiSetProp_TESTS -D CTEST_FILE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiSetProp[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P /usr/share/cmake/Modules/GoogleTestAddTests.cmake
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/ConnectionMock.cpp:228:6: error: type ‘XmlStatus’ violates the C++ One Definition Rule [-Werror=odr]
  228 | enum XmlStatus { PRE, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |      ^
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/XmlAwaiter.cpp:22:6: note: an enum with different value name is defined in another translation unit
   22 | enum XmlStatus { PRE, WAIT_TAGNAME, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |      ^
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/ConnectionMock.cpp:228:23: note: name ‘TAGNAME’ differs from name ‘WAIT_TAGNAME’ defined in another translation unit
  228 | enum XmlStatus { PRE, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |                       ^
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/XmlAwaiter.cpp:22:23: note: mismatching definition
   22 | enum XmlStatus { PRE, WAIT_TAGNAME, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |                       ^
lto1: some warnings being treated as errors
lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ 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
[3/4] : && /usr/bin/x86_64-pc-linux-gnu-g++ -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  -O1 -Wa,--noexecstack  -Wall -Wextra -Wno-format-truncation -g -DHAVE_MREMAP -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0  -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now     -rdynamic integs/CMakeFiles/TestIndiClient.dir/TestIndiClient.cpp.o integs/CMakeFiles/TestIndiClient.dir/DriverMock.cpp.o integs/CMakeFiles/TestIndiClient.dir/ConnectionMock.cpp.o integs/CMakeFiles/TestIndiClient.dir/ProcessController.cpp.o integs/CMakeFiles/TestIndiClient.dir/IndiClientMock.cpp.o integs/CMakeFiles/TestIndiClient.dir/IndiServerController.cpp.o integs/CMakeFiles/TestIndiClient.dir/utils.cpp.o integs/CMakeFiles/TestIndiClient.dir/XmlAwaiter.cpp.o integs/CMakeFiles/TestIndiClient.dir/SharedBuffer.cpp.o integs/CMakeFiles/TestIndiClient.dir/ServerMock.cpp.o -o integs/TestIndiClient  -Wl,-rpath,/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/libs/indiclient  libs/indiclient/libindiclient.so.2.0.6  /usr/lib64/libgtest_main.so.1.13.0  -lz  -lnova  -lz  -lnova  /usr/lib64/libgtest.so.1.13.0 && cd /var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs && /usr/bin/cmake -D TEST_TARGET=TestIndiClient -D TEST_EXECUTABLE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiClient -D TEST_EXECUTOR= -D TEST_WORKING_DIR=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs -D TEST_EXTRA_ARGS= -D "TEST_PROPERTIES=TIMEOUT;5" -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=TestIndiClient_TESTS -D CTEST_FILE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiClient[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P /usr/share/cmake/Modules/GoogleTestAddTests.cmake
FAILED: integs/TestIndiClient integs/TestIndiClient[1]_tests.cmake /var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiClient[1]_tests.cmake 
: && /usr/bin/x86_64-pc-linux-gnu-g++ -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  -O1 -Wa,--noexecstack  -Wall -Wextra -Wno-format-truncation -g -DHAVE_MREMAP -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0  -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now     -rdynamic integs/CMakeFiles/TestIndiClient.dir/TestIndiClient.cpp.o integs/CMakeFiles/TestIndiClient.dir/DriverMock.cpp.o integs/CMakeFiles/TestIndiClient.dir/ConnectionMock.cpp.o integs/CMakeFiles/TestIndiClient.dir/ProcessController.cpp.o integs/CMakeFiles/TestIndiClient.dir/IndiClientMock.cpp.o integs/CMakeFiles/TestIndiClient.dir/IndiServerController.cpp.o integs/CMakeFiles/TestIndiClient.dir/utils.cpp.o integs/CMakeFiles/TestIndiClient.dir/XmlAwaiter.cpp.o integs/CMakeFiles/TestIndiClient.dir/SharedBuffer.cpp.o integs/CMakeFiles/TestIndiClient.dir/ServerMock.cpp.o -o integs/TestIndiClient  -Wl,-rpath,/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/libs/indiclient  libs/indiclient/libindiclient.so.2.0.6  /usr/lib64/libgtest_main.so.1.13.0  -lz  -lnova  -lz  -lnova  /usr/lib64/libgtest.so.1.13.0 && cd /var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs && /usr/bin/cmake -D TEST_TARGET=TestIndiClient -D TEST_EXECUTABLE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiClient -D TEST_EXECUTOR= -D TEST_WORKING_DIR=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs -D TEST_EXTRA_ARGS= -D "TEST_PROPERTIES=TIMEOUT;5" -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=TestIndiClient_TESTS -D CTEST_FILE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiClient[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P /usr/share/cmake/Modules/GoogleTestAddTests.cmake
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/ConnectionMock.cpp:228:6: error: type ‘XmlStatus’ violates the C++ One Definition Rule [-Werror=odr]
  228 | enum XmlStatus { PRE, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |      ^
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/XmlAwaiter.cpp:22:6: note: an enum with different value name is defined in another translation unit
   22 | enum XmlStatus { PRE, WAIT_TAGNAME, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |      ^
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/ConnectionMock.cpp:228:23: note: name ‘TAGNAME’ differs from name ‘WAIT_TAGNAME’ defined in another translation unit
  228 | enum XmlStatus { PRE, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |                       ^
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/XmlAwaiter.cpp:22:23: note: mismatching definition
   22 | enum XmlStatus { PRE, WAIT_TAGNAME, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |                       ^
lto1: some warnings being treated as errors
lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ 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
[4/4] : && /usr/bin/x86_64-pc-linux-gnu-g++ -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  -O1 -Wa,--noexecstack  -Wall -Wextra -Wno-format-truncation -g -DHAVE_MREMAP -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0  -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now     -rdynamic integs/CMakeFiles/TestIndiserverSingleDriver.dir/TestIndiserverSingleDriver.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/DriverMock.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/ConnectionMock.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/ProcessController.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/IndiClientMock.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/IndiServerController.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/utils.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/XmlAwaiter.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/SharedBuffer.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/ServerMock.cpp.o -o integs/TestIndiserverSingleDriver  /usr/lib64/libgtest_main.so.1.13.0  /usr/lib64/libgtest.so.1.13.0 && cd /var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs && /usr/bin/cmake -D TEST_TARGET=TestIndiserverSingleDriver -D TEST_EXECUTABLE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiserverSingleDriver -D TEST_EXECUTOR= -D TEST_WORKING_DIR=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs -D TEST_EXTRA_ARGS= -D "TEST_PROPERTIES=TIMEOUT;5" -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=TestIndiserverSingleDriver_TESTS -D CTEST_FILE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiserverSingleDriver[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P /usr/share/cmake/Modules/GoogleTestAddTests.cmake
FAILED: integs/TestIndiserverSingleDriver integs/TestIndiserverSingleDriver[1]_tests.cmake /var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiserverSingleDriver[1]_tests.cmake 
: && /usr/bin/x86_64-pc-linux-gnu-g++ -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  -O1 -Wa,--noexecstack  -Wall -Wextra -Wno-format-truncation -g -DHAVE_MREMAP -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0  -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now     -rdynamic integs/CMakeFiles/TestIndiserverSingleDriver.dir/TestIndiserverSingleDriver.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/DriverMock.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/ConnectionMock.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/ProcessController.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/IndiClientMock.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/IndiServerController.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/utils.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/XmlAwaiter.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/SharedBuffer.cpp.o integs/CMakeFiles/TestIndiserverSingleDriver.dir/ServerMock.cpp.o -o integs/TestIndiserverSingleDriver  /usr/lib64/libgtest_main.so.1.13.0  /usr/lib64/libgtest.so.1.13.0 && cd /var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs && /usr/bin/cmake -D TEST_TARGET=TestIndiserverSingleDriver -D TEST_EXECUTABLE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiserverSingleDriver -D TEST_EXECUTOR= -D TEST_WORKING_DIR=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs -D TEST_EXTRA_ARGS= -D "TEST_PROPERTIES=TIMEOUT;5" -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=TestIndiserverSingleDriver_TESTS -D CTEST_FILE=/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6_build/integs/TestIndiserverSingleDriver[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P /usr/share/cmake/Modules/GoogleTestAddTests.cmake
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/ConnectionMock.cpp:228:6: error: type ‘XmlStatus’ violates the C++ One Definition Rule [-Werror=odr]
  228 | enum XmlStatus { PRE, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |      ^
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/XmlAwaiter.cpp:22:6: note: an enum with different value name is defined in another translation unit
   22 | enum XmlStatus { PRE, WAIT_TAGNAME, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |      ^
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/ConnectionMock.cpp:228:23: note: name ‘TAGNAME’ differs from name ‘WAIT_TAGNAME’ defined in another translation unit
  228 | enum XmlStatus { PRE, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |                       ^
/var/tmp/portage/sci-libs/indilib-2.0.6/work/indi-2.0.6/integs/XmlAwaiter.cpp:22:23: note: mismatching definition
   22 | enum XmlStatus { PRE, WAIT_TAGNAME, TAGNAME, WAIT_ATTRIB, ATTRIB, QUOTE, WAIT_CLOSE };
      |                       ^
lto1: some warnings being treated as errors
lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ 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
ninja: build stopped: subcommand failed.

Previously reported downstream: https://bugs.gentoo.org/878525
Full build logs: build.log

Edit on May 6:

github-actions bot commented 5 minutes ago

This issue has been inactive for 60 days and is being marked as stale.

Not doing this dance, sorry.

Copy link

github-actions bot commented May 7, 2024

This issue has been inactive for 60 days and is being marked as stale.

Copy link

This issue has been closed due to inactivity.

@eli-schwartz
Copy link
Author

Thanks for the fix -- I verified it makes things pass for me too.

For future notice it may help to add the term "Fixes #2023" to your PR so it gets automatically closed as "fixed by that-other-PR". I got a notification that the stalebot closed it instead and wasn't originally planning to revisit the issue at all -- I don't usually argue with people who use stalebots -- but for some reason I ended up doing so and got extremely confused to see a referenced PR. Github doesn't give notifications for those, by the way. :)

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

No branches or pull requests

2 participants