This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, libbacktrace]: Fix compilation on CentOS 5.8
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Ian Lance Taylor <iant at google dot com>
- Date: Tue, 18 Sep 2012 11:16:42 +0200
- Subject: Re: [PATCH, libbacktrace]: Fix compilation on CentOS 5.8
- References: <CAFULd4ZjVS4k+5jCLoRj5xeuHAN6JuTiEpHXWj-mPzBCxbewBg@mail.gmail.com>
On Tue, Sep 18, 2012 at 11:09 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
> CentOS 5.8 uses glibc version 2.5 that needs _GNU_SOURCE defined to use strnlen.
Hm, shouldn't libiberty contain a xstrnlen? I bet strnlen isn't available
everywhere.
Richard.
> 2012-09-18 Uros Bizjak <ubizjak@gmail.com>
>
> * dwarf.c: Define _GNU_SOURCE.
>
> Tested on CentOS x86_64-pc-linux-gnu. OK for mainline?
>
> Uros.
>
> Index: dwarf.c
> ===================================================================
> --- dwarf.c (revision 191413)
> +++ dwarf.c (working copy)
> @@ -30,6 +30,8 @@
> IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> POSSIBILITY OF SUCH DAMAGE. */
>
> +#define _GNU_SOURCE
> +
> #include "config.h"
>
> #include <errno.h>