Hi,
I am trying to build GNUstep Base on alpine linux, right now on 3.16. I
don't remember if I had issues on previous versions of Alpine Linux, I
don't think so, but also GNUstep might have changed since the last time
I tried.
configure:11518: checking iconv support
configure:11538: gcc -o conftest -g -O2 -I/Local/Library/Headers
-I/Local/Library/Headers -I/System/Library/Headers -shared-libgcc
-L/Local/Library/Libraries -L/Local/Library/Libraries
-L/System/Library/Libraries conftest.c -lffi -lz -lrt -ldl -lpthread
-lz >&5
conftest.c: In function 'main':
conftest.c:235:48: warning: comparison between pointer and integer
235 | { return iconv_open("UTF-8//TRANSLIT","ASCII") == -1 ? 1 : 0; }
| ^~
configure:11538: $? = 0
configure:11538: ./conftest
configure:11538: $? = 1
Why does it fail?
On a "standard" linux machine I see:
configure:11518: checking iconv support
configure:11538: gcc -o conftest -g -O2 -I/Local/Library/Headers
-I/Local/Library/Headers -I/System/Library/Headers
-I/Local/Library/Headers -I/usr/lib64/libffi/include -shared-libgcc
-L/Local/Library/Libraries -L/Local/Library/Libraries
-L/System/Library/Libraries -L/Local/Library/Libraries conftest.c -lffi
-lbfd -lz -liberty -lrt -ldl -lpthread -lz >&5
conftest.c: In function 'main':
conftest.c:246:48: warning: comparison between pointer and integer
246 | { return iconv_open("UTF-8//TRANSLIT","ASCII") == -1 ? 1 : 0; }
| ^~
configure:11538: $? = 0
configure:11538: ./conftest
configure:11538: $? = 0
configure:11543: result: yes, in libc
So I get the same warning... but different execution.
what could be specific to alpine linux here?
Riccardo
On Tue Sep 20, 2022 at 10:12 PM CEST, Riccardo Mottola wrote:
> Hi,>> I am trying to build GNUstep Base on alpine linux, right now on 3.16. I> don't remember if I had issues on previous versions of Alpine Linux, I> don't think so, but also GNUstep might have changed since the last time> I tried.>> configure:11518: checking iconv support> configure:11538: gcc -o conftest -g -O2 -I/Local/Library/Headers> -I/Local/Library/Headers -I/System/Library/Headers -shared-libgcc> -L/Local/Library/Libraries -L/Local/Library/Libraries> -L/System/Library/Libraries conftest.c -lffi -lz -lrt -ldl -lpthread> -lz >&5> conftest.c: In function 'main':> conftest.c:235:48: warning: comparison between pointer and integer> 235 | { return iconv_open("UTF-8//TRANSLIT","ASCII") == -1 ? 1 : 0; }
the TRANSLIT extension is not supported by musl iconv.
see: https://wiki.musl-libc.org/functional-differences-from-glibc.html#iconv
so, the configure test fails. if the program hard-requires this
support, then you can try use gnu-libiconv(-dev), and see how to link
that (i don't know if it's actually the same api/kind of thing..) by
modifying the configure files, passing flags, etc.
> | ^~> configure:11538: $? = 0> configure:11538: ./conftest> configure:11538: $? = 1>> Why does it fail?>> On a "standard" linux machine I see:>> configure:11518: checking iconv support> configure:11538: gcc -o conftest -g -O2 -I/Local/Library/Headers> -I/Local/Library/Headers -I/System/Library/Headers> -I/Local/Library/Headers -I/usr/lib64/libffi/include -shared-libgcc> -L/Local/Library/Libraries -L/Local/Library/Libraries> -L/System/Library/Libraries -L/Local/Library/Libraries conftest.c -lffi > -lbfd -lz -liberty -lrt -ldl -lpthread -lz >&5> conftest.c: In function 'main':> conftest.c:246:48: warning: comparison between pointer and integer> 246 | { return iconv_open("UTF-8//TRANSLIT","ASCII") == -1 ? 1 : 0; }> | ^~> configure:11538: $? = 0> configure:11538: ./conftest> configure:11538: $? = 0> configure:11543: result: yes, in libc>>> So I get the same warning... but different execution.> what could be specific to alpine linux here?>>> Riccardo
Hi Alice,
alice wrote:
>> conftest.c:235:48: warning: comparison between pointer and integer>> 235 | { return iconv_open("UTF-8//TRANSLIT","ASCII") == -1 ? 1 : 0; }> the TRANSLIT extension is not supported by musl iconv.> see: https://wiki.musl-libc.org/functional-differences-from-glibc.html#iconv>> so, the configure test fails. if the program hard-requires this> support, then you can try use gnu-libiconv(-dev), and see how to link> that (i don't know if it's actually the same api/kind of thing..) by> modifying the configure files, passing flags, etc.
very good, indeed, using gnu-libiconv-dev and then fiddling with the
include headers, made configure work.
Linking should be fine, because the library is installed then in the
usual place /usr/local/lib
However, linking fails. At a first glance, not only iconv, but symbols
of almost all libraries are missing:
...
/usr/lib/gcc/i586-alpine-linux-musl/11.2.1/../../../../i586-alpine-linux-musl/bin/ld:
/home/multix/code/libs-base/Source/GSTLS.m:2314: undefined reference to
`gnutls_x509_crt_init'
...
ression.m:744: undefined reference to `uregex_close_71'
/usr/lib/gcc/i586-alpine-linux-musl/11.2.1/../../../../i586-alpine-linux-musl/bin/ld:
/home/multix/code/libs-base/Source/NSRegularExpression.m:744: undefined
reference to `uregex_lookingAt_71'
...
/home/multix/code/libs-base/Source/GSFileHandle.m:298: undefined
reference to `gzread'
/usr/lib/gcc/i586-alpine-linux-musl/11.2.1/../../../../i586-alpine-linux-musl/bin/ld:
../Source/./obj/libgnustep-base.a(GSFileHandle.m.o): in function
`_i_GSFileHandle__write_length_':
looks to me like ICU, gzip, gnutls... like all linking failing! wow a
hint where this could be different from other linux?
Riccardo
On Thu Sep 22, 2022 at 11:40 PM CEST, Riccardo Mottola wrote:
> Hi Alice,>> alice wrote:> >> conftest.c:235:48: warning: comparison between pointer and integer> >> 235 | { return iconv_open("UTF-8//TRANSLIT","ASCII") == -1 ? 1 : 0; }> > the TRANSLIT extension is not supported by musl iconv.> > see: https://wiki.musl-libc.org/functional-differences-from-glibc.html#iconv> >> > so, the configure test fails. if the program hard-requires this> > support, then you can try use gnu-libiconv(-dev), and see how to link> > that (i don't know if it's actually the same api/kind of thing..) by> > modifying the configure files, passing flags, etc.>> very good, indeed, using gnu-libiconv-dev and then fiddling with the> include headers, made configure work.> Linking should be fine, because the library is installed then in the> usual place /usr/local/lib>> However, linking fails. At a first glance, not only iconv, but symbols> of almost all libraries are missing:> ...> /usr/lib/gcc/i586-alpine-linux-musl/11.2.1/../../../../i586-alpine-linux-musl/bin/ld:> /home/multix/code/libs-base/Source/GSTLS.m:2314: undefined reference to> `gnutls_x509_crt_init'>> ...> ression.m:744: undefined reference to `uregex_close_71'> /usr/lib/gcc/i586-alpine-linux-musl/11.2.1/../../../../i586-alpine-linux-musl/bin/ld:> /home/multix/code/libs-base/Source/NSRegularExpression.m:744: undefined> reference to `uregex_lookingAt_71'> ...> /home/multix/code/libs-base/Source/GSFileHandle.m:298: undefined> reference to `gzread'> /usr/lib/gcc/i586-alpine-linux-musl/11.2.1/../../../../i586-alpine-linux-musl/bin/ld:> ../Source/./obj/libgnustep-base.a(GSFileHandle.m.o): in function> `_i_GSFileHandle__write_length_':>>> looks to me like ICU, gzip, gnutls... like all linking failing! wow a> hint where this could be different from other linux?
no idea, but it sounds like the thing you are compiling forgets to link
everything at all, or expects to only load it at runtime in some fashion
and intentionally doesn't link it (iirc something about musl not
supporting this lazy loading? but i don't know much about it:) ). i'd
guess manually adding -lgnutls etc etc would fix them by linking
correctly at build time?
(or, your adjustments to the build broke all of that linking somehow)
>> Riccardo