-
Notifications
You must be signed in to change notification settings - Fork 200
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
Only use GNU specific strerror_r() API when __GLIBC__ is defined. #791
Only use GNU specific strerror_r() API when __GLIBC__ is defined. #791
Conversation
this makes me wonder if #760 is also glibc only |
@georgehansper as per @smortex's review, this has been merged in FreeBSD's port system: freebsd/freebsd-ports@48d5133 |
Thanks for this PR and the comments. I will take a closer look in good time, to ensure there are no unwanted side-effects. |
I have downloaded FreeBSD 13.1 and compiled augeas 1.14.0 successfully from
Both of these compile without need of any modification to the source tree of augeas. I have also downloaded the current FreeBSD 14.0 image (20221117), and successfully compiled augeas 1.14.0 from the above tarball, again, without any modification to the augeas source tree. (FYI: The 1.12.0 tarball also compiles without modification on FreeBSD 13.1 and 14.0) I cannot see any necessity for this PR. Thoughts? |
FreeBSD CURRENT is in LLVM 14 The ports tree imports new versions and builds the tree with these versions. |
This was only in preparation for the import of llvm and clang 15.0 into FreeBSD. We do a few runs of the whole ports tree with the new compiler, linker and standard C++ library, to see if there any problems. One of the ports that resulted in a build error was augeas, specifically because it warned on the incorrect return value conversion (char* to int). Of course on the FreeBSD ports side, we could simply suppress this warning and continue as if everything was all right, but it seemed better to fix this properly. That said, GNU libc is really the only C library that uses the |
thank you so much @DimitryAndric, that's a much more thorough explanation than i could have possibly mustered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hit this downstream in Gentoo with musl as well.
46ecd35
to
1482843
Compare
As reported in https://pkg-status.freebsd.org/gohan05/data/maini386PR265425-default/2022-12-06_12h24m32s/logs/errors/augeas-1.12.0_3.log, augeas uses a GNU specific
strerror_r()
invocation, even when compiling on FreeBSD. This is because gnulib'sregex.h
defines__USE_GNU
when_GNU_SOURCE
is used.It is better to also check for
__GLIBC__
, since the GNU specific variant ofstrerror_r()
is really a glibc invention. This will also make the code compile without warnings on Alpine Linux, which uses musl libc.