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

Unable to build build2 with glibc 2.38 #324

Closed
duarm opened this issue Aug 23, 2023 · 7 comments
Closed

Unable to build build2 with glibc 2.38 #324

duarm opened this issue Aug 23, 2023 · 7 comments
Labels
bug Something isn't working
Milestone

Comments

@duarm
Copy link

duarm commented Aug 23, 2023

Both strlcat and strlcpy are now part of glibc, the problem occurs because libpkg-config defines both on some platforms.

For tracking the issue #321 (comment)

Error:

build2-toolchain-0.16.0/libpkg-config/libpkg-config/bsdstubs.c:29:1: error: static declaration of ‘strlcpy’ follows non-static declaration
   29 | strlcpy (char* dst, const char* src, size_t siz)
      | ^~~~~~~
In file included from /home/USER/.local/src/build2-build/build2-toolchain-0.16.0/libpkg-config/libpkg-config/stdinc.h:35,
                 from /home/USER/.local/src/build2-build/build2-toolchain-0.16.0/libpkg-config/libpkg-config/bsdstubs.c:17:
/usr/include/string.h:506:15: note: previous declaration of ‘strlcpy’ with type ‘size_t(char * restrict,  const char * restrict,  size_t)’ {aka ‘long unsigned int(char * restrict,  const char * restrict,  long unsigned int)’}
  506 | extern size_t strlcpy (char *__restrict __dest,
      |               ^~~~~~~
/home/USER/.local/src/build2-build/build2-toolchain-0.16.0/libpkg-config/libpkg-config/bsdstubs.c:67:1: error: static declaration of ‘strlcat’ follows non-static declaration
   67 | strlcat (char* dst, const char* src, size_t siz)
      | ^~
@boris-kolpackov
Copy link
Member

[...] tried to manually patch libpkg-config/ from the install script, but it's not working, same error, even If I define HAVE_STRLCAT in config.h, it's probably a configuration problem tho, it should be working.

The install script by default (unless --local is specified) will build libpkg-config twice: once from local version (which you have patched) to build the bootstrap binary and another from package (which doesn't have the patch). So I think there is a good chance that that's what you are seeing.

In any case, I've applied this fix to the staged version of the toolchain and you can try that without any patching: https://build2.org/community.xhtml#stage

@boris-kolpackov boris-kolpackov added this to the 0.17.0 milestone Aug 24, 2023
@boris-kolpackov boris-kolpackov added the bug Something isn't working label Aug 24, 2023
@duarm
Copy link
Author

duarm commented Aug 24, 2023

tried to build with the stage script in a clean folder, same problem with both strlcpy and strlcat

/home/USER/.local/src/build2-build/build2-toolchain-0.17.0-a.0.20230824062823.a344f8afc00a/libpkg-config/libpkg-config/bsdstubs.c:29:1: error: static declaration of ‘strlcpy’ follows non-static declaration
   29 | strlcpy (char* dst, const char* src, size_t siz)
      | ^~~~~~~

I've confirmed and the patches are there, don't think it worked

additional information

[@USER]$ /lib/libc.so.6
GNU C Library (GNU libc) stable release version 2.38.
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 13.2.1 20230801.
libc ABIs: UNIQUE IFUNC ABSOLUTE
Minimum supported kernel: 4.4.0
For bug reporting instructions, please see:
<https://bugs.archlinux.org/>.

@boris-kolpackov
Copy link
Member

I've confirmed and the patches are there, don't think it worked

Yeah, I think I know what it is: we need to include a header that defines the __GLIBC*__ macros (<features.h>). I've fixed this some more and restaged, can you give it another try (i.e., re-download the install script, etc).

Thanks for your patience in sticking with this!

@duarm
Copy link
Author

duarm commented Aug 24, 2023

it works! Thanks for fixing it

@hrantsp
Copy link

hrantsp commented May 6, 2024

Hello everyone, I'm having the same problem with the same version running on Ubuntu 24.04 (x86_64).

Can anyone, please, help me with this?

Thanks in advance.

build2-toolchain-0.16.0/libpkg-config/libpkg-config/bsdstubs.c:29:1: error: static declaration of ‘strlcpy’ follows non-static declaration
   29 | strlcpy (char* dst, const char* src, size_t siz)

      | ^~~~~~~
build2-toolchain-0.16.0/libpkg-config/libpkg-config/bsdstubs.c:67:1: error: static declaration of ‘strlcat’ follows non-static declaration
   67 | strlcat (char* dst, const char* src, size_t siz)
      | ^~~~~~~

@boris-kolpackov
Copy link
Member

The release that will fix this is a few weeks away. In the meantime I suggest that you use the latest staged version: https://build2.org/community.xhtml#stage

@hrantsp
Copy link

hrantsp commented May 7, 2024

Thank you for the reply, Boris.

Succeded with the latest staged version. Good luck to your team for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants