NetBSD Problem Report #46802

From www@NetBSD.org  Wed Aug 15 09:36:08 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id EC47663B882
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 15 Aug 2012 09:36:07 +0000 (UTC)
Message-Id: <20120815093605.B93A863B85F@www.NetBSD.org>
Date: Wed, 15 Aug 2012 09:36:05 +0000 (UTC)
From: netbsd@marino.st
Reply-To: netbsd@marino.st
To: gnats-bugs@NetBSD.org
Subject: lang/clang: path issue due to being built on system compiler
X-Send-Pr-Version: www-1.0

>Number:         46802
>Category:       pkg
>Synopsis:       lang/clang: path issue due to being built on system compiler
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 15 09:40:00 +0000 2012
>Closed-Date:    Tue Apr 16 12:43:22 +0000 2013
>Last-Modified:  Tue Apr 16 12:43:22 +0000 2013
>Originator:     John Marino
>Release:        DragonFly 3.1
>Organization:
>Environment:
>Description:
Clang apparently doesn't bootstrap itself, but builds with the system compiler.

The DragonFly compilers will automatically insert an rpath of "/usr/lib/gcc41" or "/usr/lib/gcc44" to every built executable.  And it's doing it for clang.

> readelf -a /usr/pkg/bin/clang++ | grep -i rpath
 0x000000000000000f (RPATH)  Library rpath: [/usr/lib/gcc44:/usr/pkg/lib]

> ldd /usr/pkg/bin/clang++
/usr/pkg/bin/clang++:
	libpthread.so.0 => /usr/lib/libpthread.so.0 (0x802359000)
	libstdc++.so.9 => /usr/lib/gcc44/libstdc++.so.9 (0x802570000)
	libm.so.3 => /usr/lib/libm.so.3 (0x802884000)
	libc.so.7 => /usr/lib/libc.so.7 (0x802aa3000)

The result is that clang tries to use system gcc libstd++ which doesn't end well.
>How-To-Repeat:
Build clang on any compiler that automatically inserts a base runpath.  Perhaps DragonFly is unique here.

>Fix:
Clang needs to build itself, and it needs to specify it's own libstd++ inside the build directory rather than relying on system libstdc++.  

>Release-Note:

>Audit-Trail:
From: John Marino <netbsd@marino.st>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/46802: lang/clang: path issue due to being built on system
 compiler
Date: Tue, 16 Apr 2013 14:02:37 +0200

 This PR can be closed.
 1) The original report was in error, this was caused by something else
 2) It's been resolved in recent clang packages and recently upstream as 
 well.

 Thanks,
 John

State-Changed-From-To: open->closed
State-Changed-By: joerg@NetBSD.org
State-Changed-When: Tue, 16 Apr 2013 12:43:22 +0000
State-Changed-Why:
As requested.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.