mailing list of musl libc
 help / color / mirror / code / Atom feed
* Question about missing linux/version.h while statically compiling Redis
@ 2013-01-25 12:43 Olivier Goudron
  2013-01-25 12:57 ` Luca Barbato
  2013-01-25 13:59 ` John Spencer
  0 siblings, 2 replies; 8+ messages in thread
From: Olivier Goudron @ 2013-01-25 12:43 UTC (permalink / raw)
  To: musl

Hello,

I am using a 32bits Debian host.
I have installed musl-libc from git today.
I have configured musl-libc with :
./configure --prefix=/usr/local/musl --exec-prefix=/usr/local --disable-shared
The "hello word" compilation test work.

I am trying to statically compile redis with musl-libc wrapper.
I start the compilation with : CC=musl-gcc make
And the compilation stop with error :
In file included from ae.c:45:
config.h:87:27: error: linux/version.h: Aucun fichier ou dossier de ce type

What should i do ?

Can i copy the linux/version.h from my local glibc include directory
to musl-libc include directory ?

Thanks in advance, Olivier.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Question about missing linux/version.h while statically compiling Redis
  2013-01-25 12:43 Question about missing linux/version.h while statically compiling Redis Olivier Goudron
@ 2013-01-25 12:57 ` Luca Barbato
  2013-01-25 13:05   ` Olivier Goudron
  2013-01-25 13:59 ` John Spencer
  1 sibling, 1 reply; 8+ messages in thread
From: Luca Barbato @ 2013-01-25 12:57 UTC (permalink / raw)
  To: musl

On 25/01/13 13:43, Olivier Goudron wrote:
> Hello,
> 
> I am using a 32bits Debian host.
> I have installed musl-libc from git today.
> I have configured musl-libc with :
> ./configure --prefix=/usr/local/musl --exec-prefix=/usr/local --disable-shared
> The "hello word" compilation test work.
> 
> I am trying to statically compile redis with musl-libc wrapper.
> I start the compilation with : CC=musl-gcc make
> And the compilation stop with error :
> In file included from ae.c:45:
> config.h:87:27: error: linux/version.h: Aucun fichier ou dossier de ce type
> 
> What should i do ?
> 
> Can i copy the linux/version.h from my local glibc include directory
> to musl-libc include directory ?
> 
> Thanks in advance, Olivier.
> 
Possibly you need all the kernel headers (linux-headers package)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Question about missing linux/version.h while statically compiling Redis
  2013-01-25 12:57 ` Luca Barbato
@ 2013-01-25 13:05   ` Olivier Goudron
  0 siblings, 0 replies; 8+ messages in thread
From: Olivier Goudron @ 2013-01-25 13:05 UTC (permalink / raw)
  To: musl

The compilation worked without kernel headers installed when done with glibc.

I have installed nevertheless kernel headers but this does not solved
the problem. Compilation failed the same way.

Thanks for trying to help me, Olivier.

2013/1/25 Luca Barbato <lu_zero@gentoo.org>:
> On 25/01/13 13:43, Olivier Goudron wrote:
>> Hello,
>>
>> I am using a 32bits Debian host.
>> I have installed musl-libc from git today.
>> I have configured musl-libc with :
>> ./configure --prefix=/usr/local/musl --exec-prefix=/usr/local --disable-shared
>> The "hello word" compilation test work.
>>
>> I am trying to statically compile redis with musl-libc wrapper.
>> I start the compilation with : CC=musl-gcc make
>> And the compilation stop with error :
>> In file included from ae.c:45:
>> config.h:87:27: error: linux/version.h: Aucun fichier ou dossier de ce type
>>
>> What should i do ?
>>
>> Can i copy the linux/version.h from my local glibc include directory
>> to musl-libc include directory ?
>>
>> Thanks in advance, Olivier.
>>
> Possibly you need all the kernel headers (linux-headers package)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Question about missing linux/version.h while statically compiling Redis
  2013-01-25 12:43 Question about missing linux/version.h while statically compiling Redis Olivier Goudron
  2013-01-25 12:57 ` Luca Barbato
@ 2013-01-25 13:59 ` John Spencer
  2013-01-25 15:01   ` Szabolcs Nagy
  1 sibling, 1 reply; 8+ messages in thread
From: John Spencer @ 2013-01-25 13:59 UTC (permalink / raw)
  To: olivier.goudron; +Cc: musl

On 01/25/2013 01:43 PM, Olivier Goudron wrote:
> config.h:87:27: error: linux/version.h: Aucun fichier ou dossier de ce type
>
> What should i do ?
>
> Can i copy the linux/version.h from my local glibc include directory
> to musl-libc include directory ?
>
> Thanks in advance, Olivier.
>
as linux/ suggests, this is a linux header, and not related to the libc 
in use.
i.e. everything in linux/ is provided by the linux kernel.

sabotage linux has a package linux-kernel-headers which has a download 
url for a header tarball that includes linux/version.h:
http://mirror.wzff.de/sabotage/tarballs/kernel-headers-3.3.4-1.tar.gz

alternatively since the uapi split you may now be able to download the 
kernel headers straight from kernel.org

well-behaving programs do not include kernel headers, so you might want 
to file a bug at the redis bugtracker.
the inclusion from config.h suggests that there was a configure check 
for this header which for some reason (you may want to inspect 
config.log) succeeded despite the lack of this header on your system.

btw: french error messages are not very helpful


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Question about missing linux/version.h while statically compiling Redis
  2013-01-25 13:59 ` John Spencer
@ 2013-01-25 15:01   ` Szabolcs Nagy
  2013-01-25 15:52     ` Olivier Goudron
  0 siblings, 1 reply; 8+ messages in thread
From: Szabolcs Nagy @ 2013-01-25 15:01 UTC (permalink / raw)
  To: musl

* John Spencer <maillist-musl@barfooze.de> [2013-01-25 14:59:44 +0100]:
> On 01/25/2013 01:43 PM, Olivier Goudron wrote:
> >config.h:87:27: error: linux/version.h: Aucun fichier ou dossier de ce type
> >
> >What should i do ?
> >
> >Can i copy the linux/version.h from my local glibc include directory
> >to musl-libc include directory ?
> >
> >Thanks in advance, Olivier.
> >
> as linux/ suggests, this is a linux header, and not related to the
> libc in use.
> i.e. everything in linux/ is provided by the linux kernel.
> 

debian has a linux-libc-dev and libc6-dev
(glibc) depends on it

i guess other systems are similar, so you
have a /usr/include/linux directory on a
glibc system

musl does not depend on the linux headers

and you cannot use the host's /usr/include
with musl, you need to install all the
dependencies of redis (in this case the
linux headers) to a musl specific prefix

> sabotage linux has a package linux-kernel-headers which has a
> download url for a header tarball that includes linux/version.h:
> http://mirror.wzff.de/sabotage/tarballs/kernel-headers-3.3.4-1.tar.gz
> 

i assume the arch specific asm dirs are included

(the contents of include/ and arch/$ARCH/include/
are needed)

> the inclusion from config.h suggests that there was a configure
> check for this header which for some reason (you may want to inspect
> config.log) succeeded despite the lack of this header on your
> system.
> 

yes that's probably wrong

> btw: french error messages are not very helpful

before sending a bugreport:
export LC_ALL=C;

(it's enough to set LC_MESSAGES but LC_ALL is shorter)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Question about missing linux/version.h while statically compiling Redis
  2013-01-25 15:01   ` Szabolcs Nagy
@ 2013-01-25 15:52     ` Olivier Goudron
  2013-01-25 16:23       ` Szabolcs Nagy
  2013-01-25 16:28       ` John Spencer
  0 siblings, 2 replies; 8+ messages in thread
From: Olivier Goudron @ 2013-01-25 15:52 UTC (permalink / raw)
  To: musl

Thanks to your explainations Nagy, i have understand what was needed.

The compilation goes further but end now here :
debug.c:37:22: error: execinfo.h: No such file or directory

Does execinfo.h is specific to gnu libc ?

Olivier.

2013/1/25 Szabolcs Nagy <nsz@port70.net>:
> * John Spencer <maillist-musl@barfooze.de> [2013-01-25 14:59:44 +0100]:
>> On 01/25/2013 01:43 PM, Olivier Goudron wrote:
>> >config.h:87:27: error: linux/version.h: Aucun fichier ou dossier de ce type
>> >
>> >What should i do ?
>> >
>> >Can i copy the linux/version.h from my local glibc include directory
>> >to musl-libc include directory ?
>> >
>> >Thanks in advance, Olivier.
>> >
>> as linux/ suggests, this is a linux header, and not related to the
>> libc in use.
>> i.e. everything in linux/ is provided by the linux kernel.
>>
>
> debian has a linux-libc-dev and libc6-dev
> (glibc) depends on it
>
> i guess other systems are similar, so you
> have a /usr/include/linux directory on a
> glibc system
>
> musl does not depend on the linux headers
>
> and you cannot use the host's /usr/include
> with musl, you need to install all the
> dependencies of redis (in this case the
> linux headers) to a musl specific prefix
>
>> sabotage linux has a package linux-kernel-headers which has a
>> download url for a header tarball that includes linux/version.h:
>> http://mirror.wzff.de/sabotage/tarballs/kernel-headers-3.3.4-1.tar.gz
>>
>
> i assume the arch specific asm dirs are included
>
> (the contents of include/ and arch/$ARCH/include/
> are needed)
>
>> the inclusion from config.h suggests that there was a configure
>> check for this header which for some reason (you may want to inspect
>> config.log) succeeded despite the lack of this header on your
>> system.
>>
>
> yes that's probably wrong
>
>> btw: french error messages are not very helpful
>
> before sending a bugreport:
> export LC_ALL=C;
>
> (it's enough to set LC_MESSAGES but LC_ALL is shorter)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Question about missing linux/version.h while statically compiling Redis
  2013-01-25 15:52     ` Olivier Goudron
@ 2013-01-25 16:23       ` Szabolcs Nagy
  2013-01-25 16:28       ` John Spencer
  1 sibling, 0 replies; 8+ messages in thread
From: Szabolcs Nagy @ 2013-01-25 16:23 UTC (permalink / raw)
  To: musl

* Olivier Goudron <olivier.goudron@gmail.com> [2013-01-25 16:52:43 +0100]:
> Thanks to your explainations Nagy, i have understand what was needed.
> 
> The compilation goes further but end now here :
> debug.c:37:22: error: execinfo.h: No such file or directory
> 
> Does execinfo.h is specific to gnu libc ?

execinfo.h provides the glibc backtrace(3) api

it is non-portable and it should not
be called from production software
(it relies on fragile technology: only works
with certain non-standard linker and compiler
options and can easily break)

so they should test for execinfo.h in their
configure or at least provide a way to disable it


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Question about missing linux/version.h while statically compiling Redis
  2013-01-25 15:52     ` Olivier Goudron
  2013-01-25 16:23       ` Szabolcs Nagy
@ 2013-01-25 16:28       ` John Spencer
  1 sibling, 0 replies; 8+ messages in thread
From: John Spencer @ 2013-01-25 16:28 UTC (permalink / raw)
  To: musl; +Cc: Olivier Goudron

[-- Attachment #1: Type: text/plain, Size: 1174 bytes --]

On 01/25/2013 04:52 PM, Olivier Goudron wrote:
> Thanks to your explainations Nagy, i have understand what was needed.
>
> The compilation goes further but end now here :
> debug.c:37:22: error: execinfo.h: No such file or directory
>
> Does execinfo.h is specific to gnu libc ?
yes, it is specific to glibc.
it provides:

backtrace()
backtrace_symbols()
backtrace_symbols_fd()

which are not defined in any standard.
man backtrace says:

VERSIONS
        backtrace(),  backtrace_symbols(),  and backtrace_symbols_fd() 
are pro‐
        vided in glibc since version 2.1.

CONFORMING TO
        These functions are GNU extensions.


so the configure script of redis should check for availability of this 
functionality, and only make use of it when it is available.

however this functionality is of dubious value, it is not the job of a 
program to print a backtrace after it crashed.
especially since a crash means that undefined behaviour was invoked, so 
anything can happen.
getting a backtrace is the job of the debugger (gdb).

i have attached a dummy header which makes these symbols a no-op, you 
can drop it into musl's include dir or into the redis source tree.

[-- Attachment #2: execinfo.h --]
[-- Type: text/x-chdr, Size: 143 bytes --]

#ifndef _EXECINFO_H
#define _EXECINFO_H

define backtrace(A,B) 0
define backtrace_symbols(A, B) 0
define backtrace_symbols_fd(A,B,C) 0

#endif

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-25 16:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-25 12:43 Question about missing linux/version.h while statically compiling Redis Olivier Goudron
2013-01-25 12:57 ` Luca Barbato
2013-01-25 13:05   ` Olivier Goudron
2013-01-25 13:59 ` John Spencer
2013-01-25 15:01   ` Szabolcs Nagy
2013-01-25 15:52     ` Olivier Goudron
2013-01-25 16:23       ` Szabolcs Nagy
2013-01-25 16:28       ` John Spencer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).