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

net-fs/cifs-utils fails to build with ltoize #893

Open
jonesmz opened this issue Jan 22, 2024 · 1 comment
Open

net-fs/cifs-utils fails to build with ltoize #893

jonesmz opened this issue Jan 22, 2024 · 1 comment

Comments

@jonesmz
Copy link
Contributor

jonesmz commented Jan 22, 2024

x86_64-pc-linux-gnu-gcc -Wall -Wextra -D_FORTIFY_SOURCE=2 -fpie -pie -Wl,-z,relro,-z,now -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=auto -fuse-linker-plugin -march=core2 -mtune=generic -mpopcnt -Wl,-O1 -Wl,--as-needed  -Wl,-O1 -Wl,--as-needed -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=auto -fuse-linker-plugin -march=core2 -mtune=generic -mpopcnt -O2 -pipe -o mount.cifs mount.cifs.o mtab.o resolve_host.o util.o  -lcap-ng
In function ‘strlcat’,
    inlined from ‘resolve_host’ at resolve_host.c:95:4:
/usr/include/bits/string_fortified.h:167:1: error: inlining failed in call to ‘always_inline’ ‘strlcat.localalias’: function not inlinable
  167 | __NTH (strlcat (char *__restrict __dest, const char *__restrict __src,
      | ^
/usr/include/bits/string_fortified.h:174:10: note: called from here
  174 |   return __strlcat_alias (__dest, __src, __n);
      |          ^
In function ‘strlcat’,
    inlined from ‘resolve_host’ at resolve_host.c:97:3:
/usr/include/bits/string_fortified.h:167:1: error: inlining failed in call to ‘always_inline’ ‘strlcat.localalias’: function not inlinable
  167 | __NTH (strlcat (char *__restrict __dest, const char *__restrict __src,
      | ^
/usr/include/bits/string_fortified.h:174:10: note: called from here
  174 |   return __strlcat_alias (__dest, __src, __n);
      |          ^
In function ‘strlcpy’,
    inlined from ‘cifscreds_pam_update’ at pam_cifscreds.c:294:3:
/usr/include/bits/string_fortified.h:150:1: error: inlining failed in call to ‘always_inline’ ‘strlcpy.localalias’: function not inlinable
  150 | __NTH (strlcpy (char *__restrict __dest, const char *__restrict __src,
      | ^
/usr/include/bits/string_fortified.h:157:10: note: called from here
  157 |   return __strlcpy_alias (__dest, __src, __n);
      |          ^
In function ‘strlcpy’,
    inlined from ‘cifscreds_pam_add’ at pam_cifscreds.c:175:3:
/usr/include/bits/string_fortified.h:150:1: error: inlining failed in call to ‘always_inline’ ‘strlcpy.localalias’: function not inlinable
  150 | __NTH (strlcpy (char *__restrict __dest, const char *__restrict __src,
      | ^
/usr/include/bits/string_fortified.h:157:10: note: called from here
  157 |   return __strlcpy_alias (__dest, __src, __n);
      |          ^
make[3]: *** [/var/tmp/portage/net-fs/cifs-utils-7.0/temp/ccHLM2ob.mk:2: /var/tmp/portage/net-fs/cifs-utils-7.0/temp/ccjIdHyx.ltrans0.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 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[2]: *** [Makefile:1487: pam_cifscreds.so] Error 1
make[2]: *** Waiting for unfinished jobs....
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/net-fs/cifs-utils-7.0/temp/ccLNYWt8.ltrans0.ltrans.o: in function `main':
<artificial>:(.text.startup+0xb5f): warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
make[2]: Leaving directory '/var/tmp/portage/net-fs/cifs-utils-7.0/work/cifs-utils-7.0'
make[1]: *** [Makefile:986: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/net-fs/cifs-utils-7.0/work/cifs-utils-7.0'
make: *** [Makefile:499: all] Error 2

Adding

net-fs/cifs-utils *FLAGS-="-flto*"
net-fs/cifs-utils *FLAGS-="${GRAPHITE}"
net-fs/cifs-utils *FLAGS-="-fdevirtualize-at-ltrans"

to package.cflags fixes it

@ZhennanWu
Copy link

ZhennanWu commented Jan 27, 2024

Hit the same problem here!

I only hit this problem after upgrading gcc-12 to gcc-13.

  1. gcc-12.3.1_p20230825 building net-fs/cifs-utils-7.0: Success
  2. gcc-13.2.1_p20240113-r1 building net-fs/cifs-utils-7.0 (an --empty-tree build): Fail with the exact same message

Edit: Confirmed the solution, although the original solution is an overkill. You just need to add

net-fs/cifs-utils *FLAGS-="-flto*"

Getting rid of -flto is already enough.

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