develooper Front page | perl.perl5.porters | Postings from June 2019

Re: [perl #134189] configure: ubuntu without gcc

Thread Previous | Thread Next
From:
ilmari
Date:
June 10, 2019 21:06
Subject:
Re: [perl #134189] configure: ubuntu without gcc
Message ID:
d8jpnnlxi9r.fsf@dalvik.ping.uio.no
"Hugo van der Sanden via RT" <perlbug-followup@perl.org> writes:

> On Mon, 10 Jun 2019 08:52:48 -0700, jkeenan wrote:
>> This is puzzling.  I've been running Ubuntu 18.04.02 LTS for most of a
>> year now.  I don't recall having to specifically install gcc.
>> However, I was upgrading the OS on a machine from 16.04.  Still, if
>> anything I would suspect you'd have to manually install clang rather
>> than gcc.
>
> I _did_ manually (apt-)install clang; I had also assumed I'd get gcc for free.

Development tools are not installed by default, but the
'build-essential' package, which is an implicit build-dependency of
every source package, does depend on gcc.

I've installed a fresh bionic VM and installed just git, clang, and
make, and I can reproduce the problem.  It boils down to hints/linux.sh
hard-coding gcc to get the multi-arch library paths for the 'plibpth'
variable.  Clang does support the -print-search-dirs option, and
changing the hints file to use cc instead of gcc does work, but we'd
have to only do that if cc is clang.  As far as I can tell there's no
Configure variable for this, but Configure has a comment that ccname=gcc
for clang, so something like this might be okay, or explicitly checking
for /usr/bin/clang before falling back to $cc.

diff --git a/hints/linux.sh b/hints/linux.sh
index a985a8ee1b..059e929997 100644
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -165,6 +165,8 @@ esac
 # plibpth to bypass this check.
 if [ -x /usr/bin/gcc ] ; then
     gcc=/usr/bin/gcc
+elif [ "$ccname" = "gcc" ]; then
+    gcc="$cc"
 else
     gcc=gcc
 fi

- ilmari
-- 
- Twitter seems more influential [than blogs] in the 'gets reported in
  the mainstream press' sense at least.               - Matt McLeod
- That'd be because the content of a tweet is easier to condense down
  to a mainstream media article.                      - Calle Dybedahl

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About