mailing list of musl libc
 help / color / mirror / code / Atom feed
From: John Spencer <maillist-musl@barfooze.de>
To: musl@lists.openwall.com
Cc: Olivier Goudron <olivier.goudron@gmail.com>
Subject: Re: Question about missing linux/version.h while statically compiling Redis
Date: Fri, 25 Jan 2013 17:28:55 +0100	[thread overview]
Message-ID: <5102B2C7.4020804@barfooze.de> (raw)
In-Reply-To: <CABv4eg0qwnWZDgR4dgo4AyLH_ON9puwLZHy0Mj-Rb+jL3fwMTg@mail.gmail.com>

[-- 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

      parent reply	other threads:[~2013-01-25 16:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-25 12:43 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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5102B2C7.4020804@barfooze.de \
    --to=maillist-musl@barfooze.de \
    --cc=musl@lists.openwall.com \
    --cc=olivier.goudron@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).