-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
configure: ubuntu without gcc #17043
Comments
From @hvdsCreated by @hvdsOn this new computer with a freshly installed Ubuntu (bionic), I tried Tracking back, I found during configure that it had: I then found that I hadn't actually installed gcc on this machine, so After installing gcc (which updated the /usr/bin/cc link), retrying the Not sure if the fault here lies with me, perl or clang. Perl Info
|
From @jkeenanOn Mon, 10 Jun 2019 14:51:28 GMT, hv 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. [snip]
What's also odd is that my Linux kernel is only at the 4.15 level -- notwithstanding the fact that I diligently apply all Software Updates. $ uname -a Thank you very much. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @hvdsOn Mon, 10 Jun 2019 08:52:48 -0700, jkeenan wrote:
I _did_ manually (apt-)install clang; I had also assumed I'd get gcc for free. Hugo |
From @ilmari"Hugo van der Sanden via RT" <perlbug-followup@perl.org> writes:
Development tools are not installed by default, but the I've installed a fresh bionic VM and installed just git, clang, and Inline Patchdiff --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 |
From @hvdsOn Mon, 10 Jun 2019 14:06:38 -0700, ilmari wrote:
Sadly that doesn't appear to be the case here: after removing gcc{,-7} again to test, $ccname is empty when I try that here. The concept works though: using instead I'm sure there are better ways to do this: we should at least allow for both 'clang' and '/usr/bin/clang'. I'd also be tempted to test this before '-x /usr/bin/gcc', on the assumption that if the invoker asked for clang we should try to use it. Hugo |
From @tonycozOn Tue, 11 Jun 2019 08:41:37 -0700, hv wrote:
clang might not be called clang. For example, I installed clang and no gcc on a clean Ubuntu and /usr/bin/cc was an alias for clang, so a default Configure used "cc". The attached tries to detect if $cc is clang or if clang is available in PATH (and works-for-me). Tony |
From @tonycoz0001-perl-134189-handle-no-gcc-but-clang-is-available.patchFrom f3f4584221b8ae058caed153d2db6aeb74a3992d Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Thu, 13 Jun 2019 04:04:35 +0000
Subject: [PATCH] (perl #134189) handle no gcc, but clang is available
You can setup Ubuntu (and presumably other dists) with clang and no
gcc installed, which left plibpth unfilled.
---
hints/linux.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hints/linux.sh b/hints/linux.sh
index a985a8ee1b..796b5faada 100644
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -165,6 +165,11 @@ esac
# plibpth to bypass this check.
if [ -x /usr/bin/gcc ] ; then
gcc=/usr/bin/gcc
+# clang also provides -print-search-dirs
+elif [ ! -z "$cc" ] && $cc --version 2>/dev/null | grep -q '^clang ' ; then
+ gcc=$cc
+elif clang --version 2>/dev/null | grep -q '^clang ' ; then
+ gcc=clang
else
gcc=gcc
fi
--
2.20.1
|
From @hvdsOn Wed, 12 Jun 2019 21:10:30 -0700, tonyc wrote:
The first stanza looks good to me, but for the second stanza I'm not sure it's safe to invoke some arbitrary program called clang in your path if you haven't requested it. Hugo |
From @tonycozOn Thu, Jun 13, 2019 at 03:53:10AM -0700, Hugo van der Sanden via RT wrote:
We do it for gcc. Tony |
From @hvdsOn Thu, 13 Jun 2019 04:02:29 -0700, tonyc wrote:
I'd class clang as a relative newcomer, it feels much more likely that someone would have a program of that name in their path that has never heard of clang-the-compiler. Maybe I'm being overcautious, but it makes me nervous. Hugo |
From @tonycozOn Thu, 13 Jun 2019 04:26:48 -0700, hv wrote:
Here's a maybe more cautious version. Tony |
From @tonycoz0001-perl-134189-handle-no-gcc-but-cc-is-clang.patchFrom a17c73f3be436df41627eaf400266f9e25c15ab6 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Thu, 13 Jun 2019 04:04:35 +0000
Subject: (perl #134189) handle no gcc, but cc is clang
You can setup Ubuntu (and presumably other dists) with clang and no
gcc installed, which left plibpth unfilled.
---
hints/linux.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hints/linux.sh b/hints/linux.sh
index a985a8ee1b..8cbe7dc463 100644
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -165,6 +165,9 @@ esac
# plibpth to bypass this check.
if [ -x /usr/bin/gcc ] ; then
gcc=/usr/bin/gcc
+# clang also provides -print-search-dirs
+elif ${cc:-cc} --version 2>/dev/null | grep -q '^clang ' ; then
+ gcc=${cc:-cc}
else
gcc=gcc
fi
--
2.20.1
|
From @hvdsOn Tue, 18 Jun 2019 22:49:41 -0700, tonyc wrote:
Looks good to me, thanks. Hugo |
@tonycoz - Status changed from 'open' to 'pending release' |
Migrated from rt.perl.org#134189 (status was 'pending release')
Searchable as RT134189$
The text was updated successfully, but these errors were encountered: