Re: Why require SLOW_BUT_NO_HACKS for stubs?

2012-06-10 Thread Paul Eggert
On 06/09/2012 11:05 PM, Isaac Dunham wrote: Is there any reason not to merge Performance, surely. But if there's consensus that performance does not matter that much with musl, perhaps we should default to the slow version with musl. Is there any simple way to tell at compile-time

Re: localename: add support for musl libc

2018-02-25 Thread Bruno Haible
Hi Assaf, > > +# elif defined __linux__ && HAVE_LANGINFO_H && defined NL_LOCALE_NAME > > +/* musl libc */ > > A tiny comment about the comment :) > > You wrote "musl libc", but what the "elif defined ..." is something

Re: musl compatibility

2012-06-08 Thread Reuben Thomas
on musl.  A library that is new, actively maintained, and that calls itself a C/POSIX standard library should really address that by making it's printf posix compliant, so that gnulib's fallback doesn't even get built.  It seems that nobody who is interested in musl has looked at gnulib's

Re: localename: add support for musl libc

2018-02-25 Thread Rich Felker
On Sun, Feb 25, 2018 at 11:17:08AM +0100, Bruno Haible wrote: > Hi Assaf, > > > > +# elif defined __linux__ && HAVE_LANGINFO_H && defined NL_LOCALE_NAME > > > +/* musl libc */ > > > > A tiny comment about the comment :) > &

Re: localename: add support for musl libc

2018-02-24 Thread Assaf Gordon
Hello Bruno, On Sat, Feb 24, 2018 at 01:01:07PM +0100, Bruno Haible wrote: > On Alpine Linux 3.7.0, which uses musl libc, I see this test failure: [...] > diff --git a/lib/localename.c b/lib/localename.c > index 2133cbc..74c8ee0 100644 > --- a/lib/localename.c > +++ b/lib/localena

Re: musl compatibility

2012-06-12 Thread Paolo Bonzini
. musl has it, too. Paolo

Re: stdioext on musl

2012-06-17 Thread Paul Eggert
On 06/17/2012 02:56 PM, Rich Felker wrote: 1) Currently, gnulib has to go to a great length to detect musl. It uses the presence of __stdio_read and __stdio_write as an indicator; That's not valid. These are internal functions that could be renamed or disappear (e.g. be changed

Re: stdioext on musl

2012-06-17 Thread Rich Felker
ported it to musl too, which is a good thing. It would be nicer if the port used approved musl interfaces, but if musl can't or won't I already said, if gnulib can find and use these interfaces by testing that they exist and work, rather than by asking is this musl?, I'm (reluctantly) willing to add

Re: stdioext on musl

2012-06-17 Thread Bruno Haible
Rich, Then Bruno came back to us with this monstrosity of a patch that insists, for no good reason, on trying to detect musl specifically, thereby increasing the amount of broken special-cased non-portable code in gnulib rather than modernizing it. ... What is my business is that Bruno

Re: musl compatibility

2012-06-23 Thread Paul Eggert
On 06/23/2012 08:10 AM, Paolo Bonzini wrote: However, in the case of close_stdin, is this important for something that happens rarely I tend to agree that it's not that important, but isn't this question moot now that freadahead has been ported to musl? (And welcome back from vacation)

Re: musl compatibility

2012-06-08 Thread Pedro Alves
On 06/07/2012 12:14 PM, Reuben Thomas wrote: Someone just wrote a rant in a bug report for a program I maintain about gnulib being the cause of many portability problems. I tracked it down to the points raised here: http://www.etalabs.net/musl/faq.html Have you any plans to address

Re: gnulib portability issues

2012-06-10 Thread Paul Eggert
On 06/10/2012 05:43 AM, Rich Felker wrote: If the latter is acceptable though, the stdio_ext.h function __freading might suffice as an implementation. On musl doesn't __freading actually return a count? Perhaps we could just use that.

Re: musl printf bugs

2012-06-17 Thread Bruno Haible
Rich Felker wrote: checking whether printf supports the 'ls' directive... no Yep, I caught this one a while back. It's fixed in git. Good to hear that. Bruno

Re: stdioext on musl

2012-06-17 Thread Paul Eggert
__MUSL__ helps simplify gnulib's job, because it needn't bother to use a heuristic like if it has __stdio_read and __stdio_write, it must be musl, but can simply use __MUSL__ directly. If musl doesn't want to define __MUSL__, that's OK, gnulib can just define __MUSL__ on its own using that heuristic

Re: [musl] Re: musl bugs found through gnulib

2012-07-02 Thread Pádraig Brady
On 06/20/2012 05:04 AM, Rich Felker wrote: Some more updates.. On Mon, Jun 18, 2012 at 12:49:44AM +0200, Bruno Haible wrote: When I compile all of gnulib, I also get a compilation error (may be a musl or a gnulib problem, haven't investigated): fsusage.c: In function 'get_fs_usage

gnulib changes breaks Libtasn1 4.10 build with musl

2017-01-30 Thread Maxin B. John
Hi, While building Libtasn1 4.10 (which uses gnulib) with musl in Yocto project, we observed this build error: ... make[4]: *** [progname.lo] Error 1 make[4]: *** Waiting for unfinished jobs In file included from TOPDIR/tmp/work/i586-poky-linux-musl/libtasn1/4.10-r0/recipe-sysroot/usr/include

Re: [musl] Re: localename: add support for musl libc

2018-02-25 Thread Rich Felker
asing. (I think it's old glibc, or some mismatched version of glibc headers and .so, in which case it's already special-cased, right?) But probably it's just a clean failure at runtime (like returning a null pointer) where you can try something else if it failed. > > The comment /* musl */

musl compatibility

2012-06-07 Thread Reuben Thomas
Someone just wrote a rant in a bug report for a program I maintain about gnulib being the cause of many portability problems. I tracked it down to the points raised here: http://www.etalabs.net/musl/faq.html Have you any plans to address these problems? In particular, it does seem odd to place

Re: musl, printf out-of-memory test

2012-06-20 Thread Bruno Haible
address space layout randomization. Anyway, it's fixed now. I confirm that http://git.etalabs.net/cgi-bin/gitweb.cgi?p=musl;a=commitdiff;h=914949d321448bd2189bdcbce794dbae2c8ed16e fixes the bug. Bruno

Re: Why require SLOW_BUT_NO_HACKS for stubs?

2012-06-25 Thread Paul Eggert
On 06/24/2012 03:42 PM, John Spencer wrote: anything is better than a failed build. Isn't this discussion moot now, with respect to musl? That is, I thought the problem with musl and gnulib is fixed, so we don't have a failed build now. If this discussion is about what to do with some other new

Re: gnulib cross-compiling issue with musl

2013-06-18 Thread Paul Eggert
On 06/18/13 10:03, Rich Felker wrote: 1. In the #else case, instead of #error, put if(0) 2. Write a portable version of the replacement code How about this idea instead? 3. Modify gl_FUNC_FFLUSH_STDIN so that it checks at compile-time whether it's using musl, and succeeds

Re: [musl] Re: musl, printf out-of-memory test

2012-06-19 Thread Rich Felker
On Tue, Jun 19, 2012 at 12:45:50PM +0200, Bruno Haible wrote: So, the exit code 1 must have come from the crash handler. Without this crash handler: 7x I get configure:8919: checking whether printf survives out-of-memory conditions configure:8979: /arch/x86-linux/inst-musl/bin/musl-gcc

Re: localename: add support for musl libc

2018-02-25 Thread Bruno Haible
lementations ... In a perfect world, what you say would make sense. However, not all libc versions that define _NL_LOCALE_NAME also have a _NL_LOCALE_NAME that *works* [1]. It's not that I "really like poking at internals". It's that I want my code to actually work. > The comment /* musl */

Re: musl, printf out-of-memory test

2012-06-19 Thread Bruno Haible
by the time it gets to this test?? Strange indeed. With a testdir of all of gnulib, I got configure:17615: checking whether printf survives out-of-memory conditions configure:17786: /arch/x86-linux/inst-musl/bin/musl-gcc -std=gnu99 -o conftest -g -O2 -Wall conftest.c 5 configure:17789

Re: stdioext on musl

2012-06-17 Thread Bruno Haible
functions rather than trying to detect musl, I'd be willing, albeit reluctant, to add them. If you accept the proposed function names __freadahead, __freadptr, __freadptrinc, __fseterr, then we will start by using an autoconf check, and use the obvious conditionals like #if HAVE___FREADPTR

Re: [musl] Re: musl bugs found through gnulib

2012-06-17 Thread idunham
[CCing the musl list] Isaac Dunham wrote in http://lists.gnu.org/archive/html/bug-gnulib/2012-06/msg00101.html: musl is designed for standards conformance, There is a recipe, in http://sourceware.org/glibc/wiki/Testing/Gnulib, that explains how to use gnulib to check a libc against bugs

Re: [musl] Re: musl bugs found through gnulib

2012-06-17 Thread idunham
[CCing the musl list] Isaac Dunham wrote in http://lists.gnu.org/archive/html/bug-gnulib/2012-06/msg00101.html: musl is designed for standards conformance, There is a recipe, in http://sourceware.org/glibc/wiki/Testing/Gnulib, that explains how to use gnulib to check a libc against bugs

Re: Why require SLOW_BUT_NO_HACKS for stubs?

2012-06-11 Thread Isaac Dunham
On Sun, 10 Jun 2012 19:00:54 -0700 Paul Eggert egg...@cs.ucla.edu wrote: On 06/09/2012 11:05 PM, Isaac Dunham wrote: Is there any reason not to merge Performance, surely. But if there's consensus that performance does not matter that much with musl, perhaps we should default to the slow

Re: [musl] Re: musl bugs found through gnulib

2012-06-20 Thread Rich Felker
On Wed, Jun 20, 2012 at 03:28:02PM -0400, Rich Felker wrote: Replacement of getcwd, because of checking whether getcwd handles long file names properly... no, but it is partly working This test is failing because musl uses the kernel to resolve the current directory name, and the kernel

Re: gnulib cross-compiling issue with musl

2013-06-18 Thread Rich Felker
at compile-time whether it's using musl, and succeeds in that case. This should be more robust than (1), and easier to implement than (2). Can you suggest code along those lines? And if it's nontrivial, would you be willing to sign copyright papers assigning the code to the FSF

Re: musl compatibility

2012-06-12 Thread Paolo Bonzini
such rants as well. The rants are IMO, misdirected. For instance, IIRC, gnulib's freadahead use is caused by musl's printf not being posix compliant, causing gnulib to pull in its printf replacement, which doesn't work on musl. A library that is new, actively maintained, and that calls

Re: [musl] Re: musl bugs found through gnulib

2012-06-18 Thread Rich Felker
Some updates... On Mon, Jun 18, 2012 at 12:49:44AM +0200, Bruno Haible wrote: There is a recipe, in http://sourceware.org/glibc/wiki/Testing/Gnulib, that explains how to use gnulib to check a libc against bugs. When I apply this to musl-0.9.1, I get this list of problems: Replacements

Re: stdioext on musl

2012-06-19 Thread Bruno Haible
Hi Rich, The patches that you've committed at http://git.etalabs.net/cgi-bin/gitweb.cgi?p=musl;a=commitdiff;h=deb90c79e5c498fbb48de1423df034447f330e38 http://git.etalabs.net/cgi-bin/gitweb.cgi?p=musl;a=commitdiff;h=e15171b8d8e80e8b5bcf4e95b1709697858f545a go a long way at implementing

Re: stdioext on musl

2012-06-19 Thread Rich Felker
On Tue, Jun 19, 2012 at 01:46:40PM +0200, Bruno Haible wrote: Hi Rich, The patches that you've committed at http://git.etalabs.net/cgi-bin/gitweb.cgi?p=musl;a=commitdiff;h=deb90c79e5c498fbb48de1423df034447f330e38 http://git.etalabs.net/cgi-bin/gitweb.cgi?p=musl;a=commitdiff;h

Re: gnulib cross-compiling issue with musl

2013-06-19 Thread Rich Felker
the following: does it work for you? fflush, fseeko: port to musl cross-compiles * lib/fseeko.c (fseeko): Assume that fflushing stdin works if on some implementation that (1) is not known to be buggy, (2) claims conformance to POSIX.1-2008 or later, and (3) is being cross-compiled to so we can't easily

Re: [PATCH] physmem: use sysinfo on linux for physmem_total

2014-04-18 Thread Natanael Copa
On Thu, 17 Apr 2014 01:26:13 +0100 Pádraig Brady p...@draigbrady.com wrote: On 04/15/2014 03:49 PM, Pádraig Brady wrote: On 04/15/2014 03:43 PM, Natanael Copa wrote: * lib/physmem.c (physmem_total): Some systems like musl libc does not (yet) support _SC_PHYS_PAGES. Use the linux syscall

Re: [PATCH] mountlist/ptsname_r: leverage AC_HEADER_MAJOR

2016-12-05 Thread Mike Frysinger
rchive/html/bug-gnulib/2016-03/msg00025.html > > glibc-2.23 and musl now need this change it seems. > > The patch should be fine to apply though and fixes an immediate issue. > > glibc and musl cannot need a change that only affects the behaviour on > Solaris, AIX, and OSF/1.

Re: musl, fdopen test

2012-06-19 Thread Jim Meyering
Bruno Haible wrote: ... My thought in having musl skip the test is to maximize performance of fdopen, assuming you might be using it in a situation like on a newly accept()ed network connection where every syscall counts (think multi-threaded httpd). For read-only fdopen, no syscalls

Re: [PATCH] mountlist/ptsname_r: leverage AC_HEADER_MAJOR

2016-12-01 Thread Bruno Haible
Pádraig Brady wrote in http://lists.gnu.org/archive/html/bug-gnulib/2016-04/msg00022.html and pushed in http://lists.gnu.org/archive/html/bug-gnulib/2016-11/msg00116.html: > Context in http://lists.gnu.org/archive/html/bug-gnulib/2016-03/msg00025.html > glibc-2.23 and musl now need this

Re: stdioext on musl

2012-06-17 Thread Bruno Haible
Rich Felker wrote: This is not hypothetical at all. The __freading, __fwriting functions exist in various libcs (glibc, Solaris, uClibc, musl). But only in musl the value is different in some particular case. Therefore I ask you to Would you mind telling me how it's different and how

Re: stdioext on musl [was: gnulib portability issues]

2012-06-18 Thread Paul Eggert
On 06/18/2012 06:27 AM, John Spencer wrote: I just couldn't withstand to express my disgust Please refrain from such rhetoric in the future. The bug-gnulib mailing list is for discussing ways to improve gnulib, and personal attacks get in the way of its purpose.

Re: musl, printf out-of-memory test

2012-06-19 Thread Bruno Haible
Rich Felker wrote: but once I get configure:8979: /arch/x86-linux/inst-musl/bin/musl-gcc -o conftest -g -O2 -Wall conftest.c 5 configure:8982: $? = 0 configure:8986: $? = 139 configure:9031: result: no So, apparently, under memory stress, musl's printf has

Re: musl, fdopen test

2012-06-20 Thread Bruno Haible
2012-06-19 Bruno Haible br...@clisp.org fdopen: Allow implementations that don't reject invalid fd arguments. * m4/fdopen.m4 (gl_FUNC_FDOPEN): Let the test pass if fdopen(-1,...) succeeds. Reported by Rich Felker dal...@aerifal.cx. Thanks, Bruno. That

Re: musl, printf out-of-memory test

2012-06-21 Thread Tom Tromey
Jim == Jim Meyering j...@meyering.net writes: Jim That is correct. It is a feature of gdb-7.0 and newer. Jim You can inspect (watch/break-at/etc.) the same address and expect it Jim to refer to the same memory location in multiple invocations. Jim This makes gdb's command-line history even more

Re: [PATCH] physmem: use sysinfo on linux for physmem_total

2014-04-15 Thread Pádraig Brady
On 04/15/2014 03:43 PM, Natanael Copa wrote: * lib/physmem.c (physmem_total): Some systems like musl libc does not (yet) support _SC_PHYS_PAGES. Use the linux syscall sysinfo first and fallback to sysconf with _SC_PHYS_PAGES and _SC_PAGESIZE. This looks good. I confirmed the values

localename: add support for musl libc

2018-02-24 Thread Bruno Haible
On Alpine Linux 3.7.0, which uses musl libc, I see this test failure: FAIL: test-localename = ../../gltests/test-localename.c:183: assertion 'strcmp (name, "fr_FR.UTF-8") == 0' failed FAIL test-localename (exit status: 134) This patch fixes it. 2018-02-24 Br

Re: stdioext on musl

2012-06-17 Thread Rich Felker
without needing a special macro like __MUSL__? Having a symbol like __MUSL__ helps simplify gnulib's job, because it needn't bother to use a heuristic like if it has __stdio_read and __stdio_write, it must be musl, but can simply use __MUSL__ directly. This heuristic is wrong. So is checking

Re: gnulib cross-compiling issue with musl

2013-06-18 Thread Rich Felker
is this musl?, we would have something like 10 new bugs created by people doing that. This is not just speculation; it's based on questions we get on the list and on IRC. Your idea of using such a test in the form of if (is_musl) assume_non_broken(); is the first proposed use of this form

gnulib portability issues

2012-06-09 Thread Rich Felker
Hi, Reuben suggested I contact upstream since we've been discussing on the musl mailing list (m...@lists.openwall.com, archive at http://www.openwall.com/lists/musl/) some of the difficulties that have arisen out of gnulib and programs using it when building on musl (http://www.etalabs.net/musl

Re: stdioext on musl

2012-06-17 Thread Rich Felker
the implementation...? If gnulib is willing to _detect_ working functions rather than trying to detect musl, I'd be willing, albeit reluctant, to add them. If you accept the proposed function names __freadahead, __freadptr, __freadptrinc, __fseterr, then we will start by using an autoconf

Re: stdioext on musl

2012-06-17 Thread Rich Felker
or __fbufsize, that I have reported separately. There are two areas where musl libc can be modified to reduce the size of this patch. 1) Currently, gnulib has to go to a great length to detect musl. It uses the presence of __stdio_read and __stdio_write as an indicator; That's not valid

physmem_total broken with musl libc

2014-04-15 Thread Natanael Copa
Hi, It seems like physmem_total is broken with musl libc since _SC_PHYS_PAGES is not implemented. Would it be an idea to use sysinfo from sys/sysinfo.h first and then fallback to the current _SC_PHYS_PAGES * _SC_PAGESIZE? Something like: diff --git a/lib/physmem.c b/lib/physmem.c index

fchmodat(AT_SYMLINK_NOFOLLOW)

2017-08-09 Thread Eric Blake
glibc's current implementation of fchmodat() is non-compliant when AT_SYMLINK_NOFOLLOW is used. qemu just recently rediscovered what musl libc has already known for three years: on kernels new enough to support O_PATH, you can get a race-free implementation that supports AT_SYMLINK_NOFOLLOW even

Why require SLOW_BUT_NO_HACKS for stubs?

2012-06-10 Thread Isaac Dunham
Hello, I'm using musl as a libc, and have run into a number of times that gnulib stopped build. By defining SLOW_BUT_NO_HACKS, the software ended up working. This is the documented behavior, but it doesn't seem like the right one: if a stub is usable enough to allow using it, why shouldn't

Re: gnulib portability issues

2012-06-10 Thread Paul Eggert
that they don't need. Instead, wouldn't it be better to change gnulib/lib/stdio-impl.h so that it groks the musl FILE object? Naturally, this would inspect musl's internals, but that'd be no different from all those other libraries that stdio-impl.h supports.

Re: musl printf bugs

2012-06-17 Thread Rich Felker
On Sun, Jun 17, 2012 at 11:57:05PM +0200, Bruno Haible wrote: Rich Felker wrote: considering printf broken, and replacing printf because of this, is a big issue. Replacing printf is non-trivial There is also another test that causes musl's printf to be overridden: checking whether

Re: stdioext on musl

2012-06-17 Thread Rich Felker
On Mon, Jun 18, 2012 at 02:59:56AM +0200, Bruno Haible wrote: For 2), the issue is that for a stream opened in write-only mode, immediately after the fopen() call, gnulib expects fwriting(fp) to be true: Thanks. I committed a change whereby __freading now returns 1 whenever the stream is

Re: [musl] Re: musl bugs found through gnulib

2012-06-18 Thread Eric Blake
On 06/18/2012 06:11 PM, Rich Felker wrote: Some updates... On Mon, Jun 18, 2012 at 12:49:44AM +0200, Bruno Haible wrote: There is a recipe, in http://sourceware.org/glibc/wiki/Testing/Gnulib, that explains how to use gnulib to check a libc against bugs. When I apply this to musl-0.9.1, I

Re: musl, printf out-of-memory test

2012-06-20 Thread Jim Meyering
Bruno Haible wrote: Rich Felker wrote: The problem was an obscure pointer-arithmetic overflow ... where the stack pointer is near the 4GB boundary. This explains also why it occurred only with a certain probability outside gdb, but with 100% probability from within gdb: Apparently gdb runs

Re: gnulib changes breaks Libtasn1 4.10 build with musl

2017-01-30 Thread Bruno Haible
Maxin B. John wrote: > ./stdint.h:89:5: error: #if with no expression > #if > ... > (Link: http://errors.yoctoproject.org/Errors/Details/123659/ ) > > This appears to be an error introduced by the gnulib commit: > >

stdioext: Fix compilation errors with newer Android headers

2018-05-13 Thread Bruno Haible
, Android API >= 23 */ # include #endif #include @@ -29,7 +29,7 @@ int fpurge (FILE *fp) { -#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7, musl libc */ +#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7, Android API >= 23,

Re: musl compatibility

2012-06-12 Thread Eric Blake
-standard APIs on such libc's. I've heard such rants as well. The rants are IMO, misdirected. For instance, IIRC, gnulib's freadahead use is caused by musl's printf not being posix compliant, causing gnulib to pull in its printf replacement, which doesn't work on musl. A library

Re: musl, printf out-of-memory test

2012-06-19 Thread Rich Felker
, 1.0); err = errno; fprintf (stderr, printf's return value = %d, errno = %d\n, ret, err); return !(ret == 502 || (ret 0 err == ENOMEM)); } $ musl-gcc -g -Wall conftest.c -o conftest $ ./conftest /dev/null

Re: musl, printf out-of-memory test

2012-06-19 Thread Rich Felker
26174991 /data/bruno/tmp/testdir3/conftest f7f84000-f7ff8000 r-xp 08:05 26168372 /data/arch/x86-linux/inst-musl/lib/libc.so f7ff8000-f7ffa000 rwxp 00073000 08:05 26168372 /data/arch/x86-linux/inst-musl/lib

gnulib cross-compiling issue with musl

2013-06-18 Thread Rich Felker
Hi again, Last year after a great deal of discussion, we got most of the issues between gnulib and musl libc fixed. However there's one problem that keeps coming up again and again from our users: when cross-compiling, gnulib treats fseeko (well, actually fflush(stdin), which in turn requires

Re: gnulib cross-compiling issue with musl

2013-06-18 Thread Paul Eggert
to test is this musl?, we would have something like 10 new bugs created by people doing that. This is not just speculation; it's based on questions we get on the list and on IRC. Your idea of using such a test in the form of if (is_musl) assume_non_broken(); is the first proposed use of this form

mbrtowc tests: don't make assumptions about the charset the C locale

2018-02-24 Thread Bruno Haible
On Alpine Linux 3.7.0, which uses musl libc, this test fails: FAIL: test-mbrtowc5.sh == ../../gltests/test-mbrtowc.c:106: assertion 'wc == c' failed Aborted FAIL test-mbrtowc5.sh (exit status: 134) The issue is that in the C locale, musl uses the encoding that maps 0x00

Re: musl bugs found through gnulib

2012-06-17 Thread Bruno Haible
[CCing the musl list] Isaac Dunham wrote in http://lists.gnu.org/archive/html/bug-gnulib/2012-06/msg00101.html: musl is designed for standards conformance, There is a recipe, in http://sourceware.org/glibc/wiki/Testing/Gnulib, that explains how to use gnulib to check a libc against bugs. When I

Re: rationale for closein

2012-06-18 Thread Rich Felker
On Tue, Jun 19, 2012 at 01:28:24AM +0200, Bruno Haible wrote: Rich Felker wrote in http://www.openwall.com/lists/musl/2012/06/18/8: I've already discussed on this list why using an atexit function for closing stdin or stdout is the heart of the problem and the source of all the complexity

Re: stdioext on musl

2012-06-19 Thread Bruno Haible
Rich Felker wrote: stdio_ext.h okay? OK, of course. With these patches from your side, I am applying these changes to gnulib. No need for #ifdef __MUSL__ for now. 2012-06-19 Bruno Haible br...@clisp.org stdioext: Add support for musl libc. * m4/fbufmode.m4

Re: [musl] Re: musl bugs found through gnulib

2012-06-20 Thread Rich Felker
On Mon, Jun 18, 2012 at 12:49:44AM +0200, Bruno Haible wrote: [CCing the musl list] Isaac Dunham wrote in http://lists.gnu.org/archive/html/bug-gnulib/2012-06/msg00101.html: musl is designed for standards conformance, There is a recipe, in http://sourceware.org/glibc/wiki/Testing/Gnulib

Re: gnulib portability issues

2012-06-12 Thread Eric Blake
On 06/09/2012 06:39 PM, Rich Felker wrote: Hi, Reuben suggested I contact upstream since we've been discussing on the musl mailing list (m...@lists.openwall.com, archive at http://www.openwall.com/lists/musl/) some of the difficulties that have arisen out of gnulib and programs using

Re: getopt.m4 test

2012-06-19 Thread Bruno Haible
)) return 2; if (!(optind == 2)) return 3; } return 0; } === $ musl-gcc foo.c -Wall; ./a.out; echo $? 0 $ musl-gcc foo.c -Wall -DOPTIND_MIN=0; ./a.out; echo $? 1 $ musl-gcc foo.c -Wall -DOPTIND_MIN=1; ./a.out

fbufmode: fix test

2012-06-22 Thread Bruno Haible
The musl people reported that gnulib's fbuftest was testing undefined behaviour according to the ISO C standard: http://www.openwall.com/lists/musl/2012/06/17/9 http://www.openwall.com/lists/musl/2012/06/17/10 This fixes it. 2012-06-22 Bruno Haible br...@clisp.org fbufmode test: Don't

localcharset should not use directly GLIBC21 check

2013-07-25 Thread Timo Teras
Currently localcharset uses m4/glibc21.m4 (ac_cv_gnu_library_2_1) to figure out if charset.alias needs to be installed or not. However, a separate ac_cv_iconv_has_standard_charset_names or similar would be better so it can be controlled better. Especially important with musl c library, where

Re: [PATCH] physmem: use sysinfo on linux for physmem_total

2014-04-16 Thread Pádraig Brady
On 04/15/2014 03:49 PM, Pádraig Brady wrote: On 04/15/2014 03:43 PM, Natanael Copa wrote: * lib/physmem.c (physmem_total): Some systems like musl libc does not (yet) support _SC_PHYS_PAGES. Use the linux syscall sysinfo first and fallback to sysconf with _SC_PHYS_PAGES and _SC_PAGESIZE

Re: [PATCH] mountlist/ptsname_r: leverage AC_HEADER_MAJOR

2016-04-16 Thread Mike Frysinger
or use and set up some defines. > > > > Does this change fix a compilation problem? You did not say so. > > Context in http://lists.gnu.org/archive/html/bug-gnulib/2016-03/msg00025.html > glibc-2.23 and musl now need this change it seems. heh, i completely forgot about that thread ;) -mike signature.asc Description: Digital signature

Re: [PATCH] mountlist/ptsname_r: leverage AC_HEADER_MAJOR

2016-04-16 Thread Pádraig Brady
not say so. Context in http://lists.gnu.org/archive/html/bug-gnulib/2016-03/msg00025.html glibc-2.23 and musl now need this change it seems. I suggested a makedev gnulib module in the thread above as it's not just the headers that are varying, as also some systems use mkdev() and some makedev

Re: getcwd replacement + cross compilation

2018-08-23 Thread Bruno Haible
nux CentOS 5 nono, but it is partly working Linux CentOS 6 nono, but it is partly working Linux CentOS 7 noyes Linux Alpine 3.7 (musl libc) nono, but it is partly working Linux alpha (Deb

Re: getcwd replacement + cross compilation

2018-08-23 Thread Sergio Durigan Junior
but it is partly working >> Linux CentOS 7 no yes >> Linux Alpine 3.7 (musl libc) nono, but it is partly working >> Linux alpha (Debian 5) nono, but it is partly working >> kFreeBSD

Re: gnulib portability issues

2012-06-11 Thread Rich Felker
it extremely portable, there needs to be a portable fallback solution regardless of what solution ends up being best with musl. So far there are the options of the ugly dup/dup2 mess to implement a pseudo-freadahead (that only returns 0/1) or (I think this might be better) having other interfaces

Re: gnulib portability issues

2012-06-12 Thread Eric Blake
then so does the ungetc(). This is where we (musl vs glibc and perhaps you) have very different design philosophies. Using a single non-switchable buffer simplifies all the stdio code paths a lot, and reduces the cost of unget/get cycles. I wouldn't look fondly on changing this for the sake

Re: gnulib portability issues

2012-06-17 Thread Bruno Haible
Hi Paul, They're purposefully opaque so that they can be changed if an alternate implementation proves better. Dragonfly BSD attacked this problem by supplying a function __sreadahead that returns the value in question. Perhaps musl could do something similar? That would fix

Re: stdioext on musl [was: gnulib portability issues]

2012-06-18 Thread John Spencer
On Sun, 17 Jun 2012 16:59:45 -0700, Bruno Haible wrote Rich Felker wrote If gnulib is willing to _detect_ working functions rather than trying to detect musl [...] We often, but not always, use an autoconf test that verifies that a function works. Why not always? Because such a test

Re: Why require SLOW_BUT_NO_HACKS for stubs?

2012-06-25 Thread John Spencer
On 06/25/2012 08:31 AM, Paul Eggert wrote: On 06/24/2012 03:42 PM, John Spencer wrote: anything is better than a failed build. Isn't this discussion moot now, with respect to musl? That is, I thought the problem with musl and gnulib is fixed, so we don't have a failed build now. we still

Re: [PATCH v2] physmem: use sysinfo on linux for physmem_total

2014-04-19 Thread Natanael Copa
Den 18. apr. 2014 kl. 18:11 skrev Pádraig Brady p...@draigbrady.com: On 04/18/2014 10:16 AM, Natanael Copa wrote: * lib/physmem.c (physmem_total): Some systems like musl libc does not (yet) support _SC_PHYS_PAGES. Use the linux syscall sysinfo as fallback if _SC_PHYS_PAGES or _SC_PAGESIZE

ptsname_r: don't expect that this function sets errno

2018-02-24 Thread Bruno Haible
glibc ptsname_r sets errno when it fails, but this is not specified in https://www.gnu.org/software/libc/manual/html_node/Allocation.html and musl libc does not do the same thing. This leads to a test failure of 'test-ptsname_r' on Alpine Linux 3.7.0. This patch fixes it. 2018-02-24 Bruno

Re: mbrtowc tests: don't make assumptions about the charset the C locale

2018-02-24 Thread Bernhard Voelker
On 02/24/2018 12:02 PM, Bruno Haible wrote: On Alpine Linux 3.7.0, which uses musl libc, this test fails: FAIL: test-mbrtowc5.sh == ../../gltests/test-mbrtowc.c:106: assertion 'wc == c' failed Aborted FAIL test-mbrtowc5.sh (exit status: 134) The issue is that in the C

Re: mbrtowc tests: don't make assumptions about the charset the C locale

2018-02-24 Thread Bruno Haible
e dumped) > LC_ALL=C ./test-mbrtowc${EXEEXT} 5 > FAIL test-mbrtowc5.sh (exit status: 134) Oops. Thanks for the rapid notice. This patch fixes it. This time, I've tested it on glibc, musl, Mac OS X, FreeBSD, NetBSD, OpenBSD, AIX, HP-UX, IRIX, Solaris, Cygwin. 2018-02-24 Bru

Re: localename: add support for musl libc

2018-02-25 Thread Bruno Haible
Hi Assaf, > Perhaps it's worth expanding the comment to say "glibc not detected, > assuming this is musl libc" ? This is the intent of the comment, yes. But we never write it like this, in gnulib, for brevity. This is the style we use in gnulib: $ grep -h '^# *if' getloa

Re: getcwd replacement + cross compilation

2018-08-23 Thread Bruno Haible
yes > Linux Alpine 3.7 (musl libc) nono, but it is partly working > Linux alpha (Debian 5) nono, but it is partly working > kFreeBSD yes no, but it is partly working > Hurd

Re: [musl] Re: musl bugs found through gnulib

2012-06-18 Thread Rich Felker
to check a libc against bugs. When I apply this to musl-0.9.1, I get this list of problems: Replacements of *printf, because of [...] checking whether printf survives out-of-memory conditions... no No idea. Copying out the test and running it directly, it passes just fine for me

Re: [musl] Re: musl bugs found through gnulib

2012-06-19 Thread Rich Felker
: assertion failed FAIL: test-fwrite This seems like it might be a real bug. On musl, unbuffered files actually have a one-byte buffer, but on writing, the buffer is supposed to be flushed as soon as it fills, rather than waiting for another write when it's full. I'll have to run some tests

Re: gnulib portability issues

2012-06-11 Thread Rich Felker
. Then ungetc all the bytes that you read, in reverse order, and restore the file descriptor. Of course ISO C doesn't guarantee this, but it should be fairly portable in practice. No, ungetc normally can only unget one character. musl is fairly unique in allowing you to unget more

Re: stdioext on musl

2012-06-17 Thread Bruno Haible
. However, at least some packages, notably GNU M4, seem to use it directly. freadahead is one of the extended stdio functions that gnulib provides portably. Portable sometimes means that some porting effort is needed. Find attached a draft patch for gnulib, to support the stdioext functions on musl

Re: musl, fdopen test

2012-06-19 Thread Bruno Haible
. Rather, musl is the first platform to exhibit this behaviour, and gnulib's intent was to make sure that fdopen(invalid fd, ...) 1. does not crash, 2. sets errno when it fails. Eric Blake replied: The 'EBADF may fail' condition is rather weak. And since glibc guarantees a definite failure

Re: [platform-testers] new snapshot available: sed-4.4.104-290c

2018-03-23 Thread Jim Meyering
g.net/sed/sed-4.4.104-290c.tar.xz > > No sed test failures on these platforms: > AIX 2 (00FA74164C00,CC=xlc) > Alpine Linux 3.6 (with musl libc) > Darwin 16.7.0 (x86_64) > Debian 8.10 (i686) > Debian 8.9 (mips64) > Debian unstable (sparc64) > FreeBSD 11.1-RELEA

Re: musl printf bugs

2012-06-17 Thread Bruno Haible
Rich Felker wrote: considering printf broken, and replacing printf because of this, is a big issue. Replacing printf is non-trivial There is also another test that causes musl's printf to be overridden: checking whether printf supports the 'ls' directive... no The test program exited with

Re: musl compatibility

2012-06-23 Thread Paolo Bonzini
On Sun, Jun 17, 2012 at 6:15 PM, Bruno Haible br...@clisp.org wrote: Paul Eggert wrote: On 06/12/2012 04:21 AM, Paolo Bonzini wrote: perhaps we can follow the suggestion and replace if (freadahead (f)) with if (freading(f) !feof(f)) in closein.c. Yes, thanks, I like this idea the best

[PATCH] physmem: use sysinfo on linux for physmem_total

2014-04-15 Thread Natanael Copa
* lib/physmem.c (physmem_total): Some systems like musl libc does not (yet) support _SC_PHYS_PAGES. Use the linux syscall sysinfo first and fallback to sysconf with _SC_PHYS_PAGES and _SC_PAGESIZE. Signed-off-by: Natanael Copa nc...@alpinelinux.org --- lib/physmem.c | 13 - m4

  1   2   >