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

Systemd failed to compile when opening -O3 #30448

Closed
haowuge opened this issue Dec 12, 2023 · 5 comments · Fixed by #31444
Closed

Systemd failed to compile when opening -O3 #30448

haowuge opened this issue Dec 12, 2023 · 5 comments · Fixed by #31444
Labels
bug 🐛 Programming errors, that need preferential fixing build-system

Comments

@haowuge
Copy link

haowuge commented Dec 12, 2023

systemd version the issue has been seen with

255

Used distribution

Gentoo 2.14

Linux kernel version used

6.7.0-rc2+

CPU architectures issue was seen on

loongarch

Component

systemd

Expected behaviour you didn't see

Systemd cannot compile with - O3 enabled (- O2 can compile normally)

Unexpected behaviour you saw

Compilation failed

In file included from ../systemd-255/src/basic/macro.h:392,
                 from ../systemd-255/src/basic/alloc-util.h:10,
                 from ../systemd-255/src/shared/install.c:12:
../systemd-255/src/shared/install.c: In function ‘install_changes_dump’:
../systemd-255/src/shared/install.c:432:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  432 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s does not exist.",
      |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~

Steps to reproduce the problem

Options in make.conf

#COMMON_FLAGS="-march=la464 -mtune=la464 -O2 -pipe"     #Compilation successful
COMMON_FLAGS="-march=la464 -mtune=la464 -O3 -pipe"        #Compilation failed

sudo emerge --sync
sudo emerge --ask systemd                                                                                                                                 ─╯

Additional program output to the terminal or log subsystem illustrating the issue

[396/1634] loongarch64-unknown-linux-gnu-gcc -Isrc/shared/libsystemd-shared-255.a.p -Isrc/shared -I../systemd-255/src/shared -Isrc/basic -I../systemd-255/src/basic -Isrc/fundamental -I../systemd-255/src/fundamental -Isrc/systemd -I../systemd-255/src/systemd -I. -I../systemd-255 -I../systemd-255/src/libsystemd/sd-bus -I../systemd-255/src/libsystemd/sd-device -I../systemd-255/src/libsystemd/sd-event -I../systemd-255/src/libsystemd/sd-hwdb -I../systemd-255/src/libsystemd/sd-id128 -I../systemd-255/src/libsystemd/sd-journal -I../systemd-255/src/libsystemd/sd-netlink -I../systemd-255/src/libsystemd/sd-network -I../systemd-255/src/libsystemd/sd-resolve -I/usr/include/blkid -I/usr/include/libmount -I/usr/include/security -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -Wno-missing-field-initializers -Wno-unused-parameter -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=strict-flex-arrays -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong -fstrict-flex-arrays --param=ssp-buffer-size=4 -Wno-maybe-uninitialized -Wno-unused-result -ftrivial-auto-var-init=zero -Werror=shadow -march=la464 -mtune=la464 -O3 -pipe -fPIC -fno-strict-aliasing -fstrict-flex-arrays=1 -fvisibility=hidden -ffunction-sections -fdata-sections -include config.h -pthread -fvisibility=default -MD -MQ src/shared/libsystemd-shared-255.a.p/password-quality-util-pwquality.c.o -MF src/shared/libsystemd-shared-255.a.p/password-quality-util-pwquality.c.o.d -o src/shared/libsystemd-shared-255.a.p/password-quality-util-pwquality.c.o -c ../systemd-255/src/shared/password-quality-util-pwquality.c
[397/1634] loongarch64-unknown-linux-gnu-gcc -Isrc/shared/libsystemd-shared-255.a.p -Isrc/shared -I../systemd-255/src/shared -Isrc/basic -I../systemd-255/src/basic -Isrc/fundamental -I../systemd-255/src/fundamental -Isrc/systemd -I../systemd-255/src/systemd -I. -I../systemd-255 -I../systemd-255/src/libsystemd/sd-bus -I../systemd-255/src/libsystemd/sd-device -I../systemd-255/src/libsystemd/sd-event -I../systemd-255/src/libsystemd/sd-hwdb -I../systemd-255/src/libsystemd/sd-id128 -I../systemd-255/src/libsystemd/sd-journal -I../systemd-255/src/libsystemd/sd-netlink -I../systemd-255/src/libsystemd/sd-network -I../systemd-255/src/libsystemd/sd-resolve -I/usr/include/blkid -I/usr/include/libmount -I/usr/include/security -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -Wno-missing-field-initializers -Wno-unused-parameter -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=strict-flex-arrays -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong -fstrict-flex-arrays --param=ssp-buffer-size=4 -Wno-maybe-uninitialized -Wno-unused-result -ftrivial-auto-var-init=zero -Werror=shadow -march=la464 -mtune=la464 -O3 -pipe -fPIC -fno-strict-aliasing -fstrict-flex-arrays=1 -fvisibility=hidden -ffunction-sections -fdata-sections -include config.h -pthread -fvisibility=default -MD -MQ src/shared/libsystemd-shared-255.a.p/pcre2-util.c.o -MF src/shared/libsystemd-shared-255.a.p/pcre2-util.c.o.d -o src/shared/libsystemd-shared-255.a.p/pcre2-util.c.o -c ../systemd-255/src/shared/pcre2-util.c
[398/1634] loongarch64-unknown-linux-gnu-gcc -Isrc/shared/libsystemd-shared-255.a.p -Isrc/shared -I../systemd-255/src/shared -Isrc/basic -I../systemd-255/src/basic -Isrc/fundamental -I../systemd-255/src/fundamental -Isrc/systemd -I../systemd-255/src/systemd -I. -I../systemd-255 -I../systemd-255/src/libsystemd/sd-bus -I../systemd-255/src/libsystemd/sd-device -I../systemd-255/src/libsystemd/sd-event -I../systemd-255/src/libsystemd/sd-hwdb -I../systemd-255/src/libsystemd/sd-id128 -I../systemd-255/src/libsystemd/sd-journal -I../systemd-255/src/libsystemd/sd-netlink -I../systemd-255/src/libsystemd/sd-network -I../systemd-255/src/libsystemd/sd-resolve -I/usr/include/blkid -I/usr/include/libmount -I/usr/include/security -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -Wno-missing-field-initializers -Wno-unused-parameter -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=strict-flex-arrays -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong -fstrict-flex-arrays --param=ssp-buffer-size=4 -Wno-maybe-uninitialized -Wno-unused-result -ftrivial-auto-var-init=zero -Werror=shadow -march=la464 -mtune=la464 -O3 -pipe -fPIC -fno-strict-aliasing -fstrict-flex-arrays=1 -fvisibility=hidden -ffunction-sections -fdata-sections -include config.h -pthread -fvisibility=default -MD -MQ src/shared/libsystemd-shared-255.a.p/install.c.o -MF src/shared/libsystemd-shared-255.a.p/install.c.o.d -o src/shared/libsystemd-shared-255.a.p/install.c.o -c ../systemd-255/src/shared/install.c
FAILED: src/shared/libsystemd-shared-255.a.p/install.c.o 
loongarch64-unknown-linux-gnu-gcc -Isrc/shared/libsystemd-shared-255.a.p -Isrc/shared -I../systemd-255/src/shared -Isrc/basic -I../systemd-255/src/basic -Isrc/fundamental -I../systemd-255/src/fundamental -Isrc/systemd -I../systemd-255/src/systemd -I. -I../systemd-255 -I../systemd-255/src/libsystemd/sd-bus -I../systemd-255/src/libsystemd/sd-device -I../systemd-255/src/libsystemd/sd-event -I../systemd-255/src/libsystemd/sd-hwdb -I../systemd-255/src/libsystemd/sd-id128 -I../systemd-255/src/libsystemd/sd-journal -I../systemd-255/src/libsystemd/sd-netlink -I../systemd-255/src/libsystemd/sd-network -I../systemd-255/src/libsystemd/sd-resolve -I/usr/include/blkid -I/usr/include/libmount -I/usr/include/security -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -Wno-missing-field-initializers -Wno-unused-parameter -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=strict-flex-arrays -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong -fstrict-flex-arrays --param=ssp-buffer-size=4 -Wno-maybe-uninitialized -Wno-unused-result -ftrivial-auto-var-init=zero -Werror=shadow -march=la464 -mtune=la464 -O3 -pipe -fPIC -fno-strict-aliasing -fstrict-flex-arrays=1 -fvisibility=hidden -ffunction-sections -fdata-sections -include config.h -pthread -fvisibility=default -MD -MQ src/shared/libsystemd-shared-255.a.p/install.c.o -MF src/shared/libsystemd-shared-255.a.p/install.c.o.d -o src/shared/libsystemd-shared-255.a.p/install.c.o -c ../systemd-255/src/shared/install.c
In file included from ../systemd-255/src/basic/macro.h:392,
                 from ../systemd-255/src/basic/alloc-util.h:10,
                 from ../systemd-255/src/shared/install.c:12:
../systemd-255/src/shared/install.c: In function ‘install_changes_dump’:
../systemd-255/src/shared/install.c:432:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  432 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s does not exist.",
      |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-255/src/basic/log.h:254:41: note: in expansion of macro ‘log_full_errno’
  254 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:432:31: note: in expansion of macro ‘log_error_errno’
  432 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s does not exist.",
      |                               ^~~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:432:75: note: format string is defined here
  432 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s does not exist.",
      |                                                                           ^~
../systemd-255/src/shared/install.c:391:55: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  391 |                                                       "Failed to %s unit, file \"%s\" already exists.",
      |                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-255/src/basic/log.h:254:41: note: in expansion of macro ‘log_full_errno’
  254 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:390:39: note: in expansion of macro ‘log_error_errno’
  390 |                                 err = log_error_errno(changes[i].type,
      |                                       ^~~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:391:66: note: format string is defined here
  391 |                                                       "Failed to %s unit, file \"%s\" already exists.",
      |                                                                  ^~
../systemd-255/src/shared/install.c:387:55: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  387 |                                                       "Failed to %s unit, file \"%s\" already exists and is a symlink to \"%s\".",
      |                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-255/src/basic/log.h:254:41: note: in expansion of macro ‘log_full_errno’
  254 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:386:39: note: in expansion of macro ‘log_error_errno’
  386 |                                 err = log_error_errno(changes[i].type,
      |                                       ^~~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:387:66: note: format string is defined here
  387 |                                                       "Failed to %s unit, file \"%s\" already exists and is a symlink to \"%s\".",
      |                                                                  ^~
../systemd-255/src/shared/install.c:428:72: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  428 |                                 err = log_error_errno(changes[i].type, "Failed to %s unit, invalid unit reference \"%s\".",
      |                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-255/src/basic/log.h:254:41: note: in expansion of macro ‘log_full_errno’
  254 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:428:39: note: in expansion of macro ‘log_error_errno’
  428 |                                 err = log_error_errno(changes[i].type, "Failed to %s unit, invalid unit reference \"%s\".",
      |                                       ^~~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:428:83: note: format string is defined here
  428 |                                 err = log_error_errno(changes[i].type, "Failed to %s unit, invalid unit reference \"%s\".",
      |                                                                                   ^~
../systemd-255/src/shared/install.c:425:72: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  425 |                                 err = log_error_errno(changes[i].type, "Failed to %s unit, cannot alias %s as %s.",
      |                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-255/src/basic/log.h:254:41: note: in expansion of macro ‘log_full_errno’
  254 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:425:39: note: in expansion of macro ‘log_error_errno’
  425 |                                 err = log_error_errno(changes[i].type, "Failed to %s unit, cannot alias %s as %s.",
      |                                       ^~~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:425:83: note: format string is defined here
  425 |                                 err = log_error_errno(changes[i].type, "Failed to %s unit, cannot alias %s as %s.",
      |                                                                                   ^~
../systemd-255/src/shared/install.c:403:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  403 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, file %s is under the systemd unit hierarchy already.",
      |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-255/src/basic/log.h:254:41: note: in expansion of macro ‘log_full_errno’
  254 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:403:31: note: in expansion of macro ‘log_error_errno’
  403 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, file %s is under the systemd unit hierarchy already.",
      |                               ^~~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:403:75: note: format string is defined here
  403 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, file %s is under the systemd unit hierarchy already.",
      |                                                                           ^~
../systemd-255/src/shared/install.c:420:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  420 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, refusing to operate on linked unit file %s.",
      |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-255/src/basic/log.h:254:41: note: in expansion of macro ‘log_full_errno’
  254 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:420:31: note: in expansion of macro ‘log_error_errno’
  420 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, refusing to operate on linked unit file %s.",
      |                               ^~~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:420:75: note: format string is defined here
  420 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, refusing to operate on linked unit file %s.",
      |                                                                           ^~
../systemd-255/src/shared/install.c:411:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  411 |                         err = log_error_errno(changes[i].type, "Failed to %s %s, destination unit %s is a non-template unit.",
      |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-255/src/basic/log.h:254:41: note: in expansion of macro ‘log_full_errno’
  254 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:411:31: note: in expansion of macro ‘log_error_errno’
  411 |                         err = log_error_errno(changes[i].type, "Failed to %s %s, destination unit %s is a non-template unit.",
      |                               ^~~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:411:75: note: format string is defined here
  411 |                         err = log_error_errno(changes[i].type, "Failed to %s %s, destination unit %s is a non-template unit.",
      |                                                                           ^~
../systemd-255/src/shared/install.c:436:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  436 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, cannot resolve specifiers in \"%s\".",
      |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-255/src/basic/log.h:254:41: note: in expansion of macro ‘log_full_errno’
  254 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:436:31: note: in expansion of macro ‘log_error_errno’
  436 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, cannot resolve specifiers in \"%s\".",
      |                               ^~~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:436:75: note: format string is defined here
  436 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, cannot resolve specifiers in \"%s\".",
      |                                                                           ^~
../systemd-255/src/shared/install.c:407:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  407 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, invalid specifier in \"%s\".",
      |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-255/src/basic/log.h:254:41: note: in expansion of macro ‘log_full_errno’
  254 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:407:31: note: in expansion of macro ‘log_error_errno’
  407 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, invalid specifier in \"%s\".",
      |                               ^~~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:407:75: note: format string is defined here
  407 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, invalid specifier in \"%s\".",
      |                                                                           ^~
../systemd-255/src/shared/install.c:399:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  399 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s is transient or generated.",
      |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-255/src/basic/log.h:254:41: note: in expansion of macro ‘log_full_errno’
  254 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:399:31: note: in expansion of macro ‘log_error_errno’
  399 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s is transient or generated.",
      |                               ^~~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:399:75: note: format string is defined here
  399 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s is transient or generated.",
      |                                                                           ^~
../systemd-255/src/shared/install.c:416:47: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  416 |                                               "Failed to %s unit, \"%s\" is not a valid unit name.",
      |                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-255/src/basic/log.h:254:41: note: in expansion of macro ‘log_full_errno’
  254 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:415:31: note: in expansion of macro ‘log_error_errno’
  415 |                         err = log_error_errno(changes[i].type,
      |                               ^~~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:416:58: note: format string is defined here
  416 |                                               "Failed to %s unit, \"%s\" is not a valid unit name.",
      |                                                          ^~
../systemd-255/src/shared/install.c:395:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  395 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s is masked.",
      |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-255/src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-255/src/basic/log.h:254:41: note: in expansion of macro ‘log_full_errno’
  254 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:395:31: note: in expansion of macro ‘log_error_errno’
  395 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s is masked.",
      |                               ^~~~~~~~~~~~~~~
../systemd-255/src/shared/install.c:395:75: note: format string is defined here
  395 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s is masked.",
      |                                                                           ^~
cc1: some warnings being treated as errors
[399/1634] loongarch64-unknown-linux-gnu-gcc -Isrc/shared/libsystemd-shared-255.a.p -Isrc/shared -I../systemd-255/src/shared -Isrc/basic -I../systemd-255/src/basic -Isrc/fundamental -I../systemd-255/src/fundamental -Isrc/systemd -I../systemd-255/src/systemd -I. -I../systemd-255 -I../systemd-255/src/libsystemd/sd-bus -I../systemd-255/src/libsystemd/sd-device -I../systemd-255/src/libsystemd/sd-event -I../systemd-255/src/libsystemd/sd-hwdb -I../systemd-255/src/libsystemd/sd-id128 -I../systemd-255/src/libsystemd/sd-journal -I../systemd-255/src/libsystemd/sd-netlink -I../systemd-255/src/libsystemd/sd-network -I../systemd-255/src/libsystemd/sd-resolve -I/usr/include/blkid -I/usr/include/libmount -I/usr/include/security -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -Wno-missing-field-initializers -Wno-unused-parameter -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=strict-flex-arrays -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong -fstrict-flex-arrays --param=ssp-buffer-size=4 -Wno-maybe-uninitialized -Wno-unused-result -ftrivial-auto-var-init=zero -Werror=shadow -march=la464 -mtune=la464 -O3 -pipe -fPIC -fno-strict-aliasing -fstrict-flex-arrays=1 -fvisibility=hidden -ffunction-sections -fdata-sections -include config.h -pthread -fvisibility=default -MD -MQ src/shared/libsystemd-shared-255.a.p/pcrextend-util.c.o -MF src/shared/libsystemd-shared-255.a.p/pcrextend-util.c.o.d -o src/shared/libsystemd-shared-255.a.p/pcrextend-util.c.o -c ../systemd-255/src/shared/pcrextend-util.c
[400/1634] loongarch64-unknown-linux-gnu-gcc -Isrc/shared/libsystemd-shared-255.a.p -Isrc/shared -I../systemd-255/src/shared -Isrc/basic -I../systemd-255/src/basic -Isrc/fundamental -I../systemd-255/src/fundamental -Isrc/systemd -I../systemd-255/src/systemd -I. -I../systemd-255 -I../systemd-255/src/libsystemd/sd-bus -I../systemd-255/src/libsystemd/sd-device -I../systemd-255/src/libsystemd/sd-event -I../systemd-255/src/libsystemd/sd-hwdb -I../systemd-255/src/libsystemd/sd-id128 -I../systemd-255/src/libsystemd/sd-journal -I../systemd-255/src/libsystemd/sd-netlink -I../systemd-255/src/libsystemd/sd-network -I../systemd-255/src/libsystemd/sd-resolve -I/usr/include/blkid -I/usr/include/libmount -I/usr/include/security -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -Wno-missing-field-initializers -Wno-unused-parameter -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=strict-flex-arrays -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong -fstrict-flex-arrays --param=ssp-buffer-size=4 -Wno-maybe-uninitialized -Wno-unused-result -ftrivial-auto-var-init=zero -Werror=shadow -march=la464 -mtune=la464 -O3 -pipe -fPIC -fno-strict-aliasing -fstrict-flex-arrays=1 -fvisibility=hidden -ffunction-sections -fdata-sections -include config.h -pthread -fvisibility=default -MD -MQ src/shared/libsystemd-shared-255.a.p/pe-binary.c.o -MF src/shared/libsystemd-shared-255.a.p/pe-binary.c.o.d -o src/shared/libsystemd-shared-255.a.p/pe-binary.c.o -c ../systemd-255/src/shared/pe-binary.c
[401/1634] loongarch64-unknown-linux-gnu-gcc -Isrc/shared/libsystemd-shared-255.a.p -Isrc/shared -I../systemd-255/src/shared -Isrc/basic -I../systemd-255/src/basic -Isrc/fundamental -I../systemd-255/src/fundamental -Isrc/systemd -I../systemd-255/src/systemd -I. -I../systemd-255 -I../systemd-255/src/libsystemd/sd-bus -I../systemd-255/src/libsystemd/sd-device -I../systemd-255/src/libsystemd/sd-event -I../systemd-255/src/libsystemd/sd-hwdb -I../systemd-255/src/libsystemd/sd-id128 -I../systemd-255/src/libsystemd/sd-journal -I../systemd-255/src/libsystemd/sd-netlink -I../systemd-255/src/libsystemd/sd-network -I../systemd-255/src/libsystemd/sd-resolve -I/usr/include/blkid -I/usr/include/libmount -I/usr/include/security -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -Wno-missing-field-initializers -Wno-unused-parameter -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=strict-flex-arrays -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong -fstrict-flex-arrays --param=ssp-buffer-size=4 -Wno-maybe-uninitialized -Wno-unused-result -ftrivial-auto-var-init=zero -Werror=shadow -march=la464 -mtune=la464 -O3 -pipe -fPIC -fno-strict-aliasing -fstrict-flex-arrays=1 -fvisibility=hidden -ffunction-sections -fdata-sections -include config.h -pthread -fvisibility=default -MD -MQ src/shared/libsystemd-shared-255.a.p/openssl-util.c.o -MF src/shared/libsystemd-shared-255.a.p/openssl-util.c.o.d -o src/shared/libsystemd-shared-255.a.p/openssl-util.c.o -c ../systemd-255/src/shared/openssl-util.c
ninja: build stopped: subcommand failed.
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -j 4 -v
 * ERROR: sys-apps/systemd-255-r1::gentoo failed (compile phase):
 *   compile failed
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 4325:  Called meson-multilib_src_compile
 *   environment, line 2688:  Called multilib-minimal_src_compile
 *   environment, line 2944:  Called multilib_foreach_abi 'multilib-minimal_abi_src_compile'
 *   environment, line 3211:  Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 2904:  Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 2902:  Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_compile'
 *   environment, line  653:  Called multilib-minimal_abi_src_compile
 *   environment, line 2938:  Called multilib_src_compile
 *   environment, line 3431:  Called meson_src_compile
 *   environment, line 2756:  Called die
 * The specific snippet of code:
 *       "$@" || die "compile failed"
 * 
 * If you need support, post the output of `emerge --info '=sys-apps/systemd-255-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-apps/systemd-255-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-apps/systemd-255-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-apps/systemd-255-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-apps/systemd-255-r1/work/systemd-255-.lp64d'
 * S: '/var/tmp/portage/sys-apps/systemd-255-r1/work/systemd-255'

>>> Failed to emerge sys-apps/systemd-255-r1, Log file:

>>>  '/var/tmp/portage/sys-apps/systemd-255-r1/temp/build.log'

 * Messages for package sys-apps/systemd-255-r1:

 * It's recommended to set an empty value to the following kernel config option:
 * CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"

 * Messages for package sys-apps/systemd-255-r1:

 * ERROR: sys-apps/systemd-255-r1::gentoo failed (compile phase):
 *   compile failed
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 4325:  Called meson-multilib_src_compile
 *   environment, line 2688:  Called multilib-minimal_src_compile
 *   environment, line 2944:  Called multilib_foreach_abi 'multilib-minimal_abi_src_compile'
 *   environment, line 3211:  Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 2904:  Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 2902:  Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_compile'
 *   environment, line  653:  Called multilib-minimal_abi_src_compile
 *   environment, line 2938:  Called multilib_src_compile
 *   environment, line 3431:  Called meson_src_compile
 *   environment, line 2756:  Called die
 * The specific snippet of code:
 *       "$@" || die "compile failed"
 * 
 * If you need support, post the output of `emerge --info '=sys-apps/systemd-255-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-apps/systemd-255-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-apps/systemd-255-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-apps/systemd-255-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-apps/systemd-255-r1/work/systemd-255-.lp64d'
 * S: '/var/tmp/portage/sys-apps/systemd-255-r1/work/systemd-255'
@haowuge haowuge added the bug 🐛 Programming errors, that need preferential fixing label Dec 12, 2023
@github-actions github-actions bot added the pid1 label Dec 12, 2023
@mrc0mmand
Copy link
Member

I can't seem to reproduce this locally - what's your gcc version?

@mrc0mmand mrc0mmand added the needs-reporter-feedback ❓ There's an unanswered question, the reporter needs to answer label Dec 13, 2023
@yuwata yuwata added build-system and removed pid1 labels Dec 13, 2023
@haowuge
Copy link
Author

haowuge commented Dec 14, 2023

I can't seem to reproduce this locally - what's your gcc version?

I don't know if it's related to Ioongarch

❯ gcc -v
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/loongarch64-unknown-linux-gnu/13/lto-wrapper
目标:loongarch64-unknown-linux-gnu
配置为:/var/tmp/portage/sys-devel/gcc-13.2.1_p20231014/work/gcc-13-20231014/configure --host=loongarch64-unknown-linux-gnu --build=loongarch64-unknown-linux-gnu --prefix=/usr --bindir=/usr/loongarch64-unknown-linux-gnu/gcc-bin/13 --includedir=/usr/lib/gcc/loongarch64-unknown-linux-gnu/13/include --datadir=/usr/share/gcc-data/loongarch64-unknown-linux-gnu/13 --mandir=/usr/share/gcc-data/loongarch64-unknown-linux-gnu/13/man --infodir=/usr/share/gcc-data/loongarch64-unknown-linux-gnu/13/info --with-gxx-include-dir=/usr/lib/gcc/loongarch64-unknown-linux-gnu/13/include/g++-v13 --disable-silent-rules --disable-dependency-tracking --with-python-dir=/share/gcc-data/loongarch64-unknown-linux-gnu/13/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 13.2.1_p20231014 p9' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --disable-fixed-point --enable-libgomp --disable-libssp --disable-libada --disable-cet --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --without-zstd --without-isl --disable-libsanitizer --enable-default-pie --enable-default-ssp
线程模型:posix
支持的 LTO 压缩算法:zlib
gcc 版本 13.2.1 20231014 (Gentoo 13.2.1_p20231014 p9)

@thesamesam
Copy link
Contributor

cc @xen0n

I've seen this error in the past on non-amd64, I think it's a case similar to #30223 (FP which needs suppression). See https://bugs.gentoo.org/916518 too for the install case. Maybe it wasn't really fixed in the RC.

@xen0n
Copy link
Contributor

xen0n commented Dec 21, 2023

I'm not sure if this is architecture-specific after all -- the semantic analyses run before target code is called for codegen IIUC. I'll attempt to reproduce on amd64 and loong during the weekend though.

@thesamesam
Copy link
Contributor

This should be fixed by 8040fa5. @bluca would you mind queueing it for backporting? I keep hitting it on misc. arches.

@bluca bluca removed the needs-reporter-feedback ❓ There's an unanswered question, the reporter needs to answer label Mar 1, 2024
@bluca bluca closed this as completed Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Programming errors, that need preferential fixing build-system
Development

Successfully merging a pull request may close this issue.

6 participants