sgerrand / alpine-pkg-glibc

A glibc compatibility layer package for Alpine Linux
2.07k stars 280 forks source link

glibc doesn't work #69

Closed kawatoto closed 6 years ago

kawatoto commented 6 years ago

Hi I just installed this latest version of glibc but it doesn't work, alpine still using musl as libc library. Where is this installed? I would like to set directly into the LD_LIBRARY_PATH, or what do you suggest to specifi this glibc version in C code?

Thanks in advance,

frezbo commented 6 years ago

@kawatoto Alpine still uses musl as the default, its installed in /usr, all the libraries are available at /usr/glibc-compat/lib

kawatoto commented 6 years ago

Hi,

I added the path in ld_library_path export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/glibc-compat/lib

and now I'm getting the below error.

fatal error: stdlib.h: No such file or directory

Am I missing something?

frezbo commented 6 years ago

I think its most probably missing gcc or gcc++

kawatoto commented 6 years ago

GCC is installed via:

apk add --no-cache gcc

frezbo commented 6 years ago

this should help you: https://pkgs.alpinelinux.org/contents?file=stdlib.h&path=&name=&branch=edge&repo=main&arch=x86_64

Mostly a quick google with the header name and alpine works

kawatoto commented 6 years ago

Hi, I tried but still getting the undefined reference errors:

undefined reference to 'getsockname@GLIBC_2.2.5' undefined reference to 'getgrgid_r@GLIBC_2.2.5' undefined reference to 'memcpy@GLIBC_2.2.5' undefined reference to 'getenv@GLIBC_2.2.5' undefined reference to 'pthread_setspecific@GLIBC_2.2.5' undefined reference to 'closedir@GLIBC_2.2.5' undefined reference to 'sem_timedwait@GLIBC_2.2.5' undefined reference to 'mkdir@GLIBC_2.2.5' undefined reference to 'pread@GLIBC_2.2.5'

and many other glibc references.

Any help will be appreciated.

sgerrand commented 6 years ago

@kawatoto: Would you please provide further details of how you are attempting to use this package. I can't help debug these issues that you are encountering without knowing more about it.

Details like the following would be very useful:

kawatoto commented 6 years ago

Hi @sgerrand

I'm trying to build a custom activity for the below project http://www.flogo.io/ this uses alpine linux in the docker container, and the container uses alpine

uname -a

Linux 02b2ce9d5465 4.9.49-moby #1 SMP Wed Sep 27 23:17:17 UTC 2017 x86_64 Linux

more /etc/issue

Welcome to Alpine Linux 3.4 Kernel \r on an \m (\l)

I'm trying to invoke a C api and you can find the libraries in the below project https://github.com/kawatoto/FTLogo

Any help you provide will be appreciated.

Thanks, Antonio

sgerrand commented 6 years ago

Given that you're trying to use commercial software (TIBCO's FTL messaging product), I suggest using a glibc based Docker image instead of Alpine Linux. Try using the images provided by https://github.com/mikeschippers/docker-tibco, as an example.