Skip to content
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.pl with moar fails to find C compiler on older Darwin #5064

Open
p6rt opened this issue Jan 18, 2016 · 11 comments
Open

Configure.pl with moar fails to find C compiler on older Darwin #5064

p6rt opened this issue Jan 18, 2016 · 11 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jan 18, 2016

Migrated from rt.perl.org#127308 (status was 'open')

Searchable as RT127308$

@p6rt
Copy link
Author

p6rt commented Jan 18, 2016

From @jkeenan

Today I tried for the first time to build Perl 6 from source -- specifically Rakudo Star 2015.11 -- on my older Darwin/PPC. (I first tried to do so with 'rakudobrew', but that utility apparently has dependencies on more recent versions of 'git' than I can install on this machine.) Configuration failed -- but at a point so early in the process that I was surprised.

Here is what I called and got​:

##########
[rakudo] 545 $ cd rakudo-star-2015.11
[rakudo-star-2015.11] 546 $ perl Configure.pl --backend=moar --gen-moar
ATTENTION​: no --prefix supplied, building and installing to /Users/jimk/rakudo/rakudo-star-2015.11/install

Configuring and building MoarVM ...
perl Configure.pl --optimize --prefix=/Users/jimk/rakudo/rakudo-star-2015.11/install --make-install
Welcome to MoarVM!

Configuring native build environment ................... OK
  probing whether your compiler thinks that it is gcc Can't compile simple gcc probe, so something is badly wrong at build/probe.pm line 92.
Command failed (status 32512)​: perl Configure.pl --optimize --prefix=/Users/jimk/rakudo/rakudo-star-2015.11/install --make-install
##########

Well, my compiler is definitely gcc. It's still capable of building perl-5.22.1 from source. I examined ./MoarVM/build/probe.pm and just above that point I saw C code to detect a C compiler. I extracted it, compiled it and ran it.

##########

$ cat try.c
#include <stdlib.h>

int main(int argc, char **argv) {
#ifdef __GNUC__
  return EXIT_SUCCESS;
#else
  return EXIT_FAILURE;
#endif
}

$ gcc -o try try.c

$ perl -e '$rv = system(qq{./try}); print "<$rv>\n";'
<0>
##########

So the C probe works by itself, but the program in which it is embedded fails. Any ideas?

Thank you very much.
Jim Keenan
--
James E Keenan (jkeenan@​cpan.org)

@p6rt
Copy link
Author

p6rt commented Jan 18, 2016

From @jkeenan

Summary of my perl5 (revision 5 version 22 subversion 1) configuration​:
 
  Platform​:
  osname=darwin, osvers=8.11.0, archname=darwin-2level
  uname='darwin macintosh-9.local 8.11.0 darwin kernel version 8.11.0​: wed oct 10 18​:26​:00 pdt 2007; root​:xnu-792.24.17~1release_ppc power macintosh powerpc '
  config_args='-des'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  use64bitint=undef, use64bitall=undef, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -I/usr/local/include -I/opt/local/include -D_FORTIFY_SOURCE=2',
  optimize='-O3',
  cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -I/usr/local/include -I/opt/local/include'
  ccversion='', gccversion='4.0.1 (Apple Computer, Inc. build 5250)', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321, doublekind=4
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=6
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -L/usr/local/lib -L/opt/local/lib'
  libpth=/usr/local/lib /usr/lib /opt/local/lib
  libs=-lpthread -ldbm -ldl -lm -lc
  perllibs=-lpthread -ldl -lm -lc
  libc=, so=dylib, useshrplib=false, libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib'

Characteristics of this binary (from libperl)​:
  Compile-time options​: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV
  PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP
  PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
  USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
  USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME
  USE_PERLIO USE_PERL_ATOF
  Built under darwin
  Compiled at Dec 13 2015 21​:51​:07
  %ENV​:
  PERLBREW_BASHRC_VERSION="0.59"
  PERLBREW_HOME="/Users/jimk/.perlbrew"
  PERLBREW_ROOT="/Users/jimk/perl5/perlbrew"
  PERL_WORKDIR="gitwork/perl"
  @​INC​:
  /usr/local/lib/perl5/site_perl/5.22.1/darwin-2level
  /usr/local/lib/perl5/site_perl/5.22.1
  /usr/local/lib/perl5/5.22.1/darwin-2level
  /usr/local/lib/perl5/5.22.1
  /usr/local/lib/perl5/site_perl/5.20.1
  /usr/local/lib/perl5/site_perl/5.20.0
  /usr/local/lib/perl5/site_perl/5.18.0
  /usr/local/lib/perl5/site_perl/5.16.0
  /usr/local/lib/perl5/site_perl/5.14.2
  /usr/local/lib/perl5/site_perl/5.14.0
  /usr/local/lib/perl5/site_perl/5.12.0
  /usr/local/lib/perl5/site_perl/5.10.1
  /usr/local/lib/perl5/site_perl/5.10.0
  /usr/local/lib/perl5/site_perl/5.8.6
  /usr/local/lib/perl5/site_perl
  .

@p6rt
Copy link
Author

p6rt commented Jan 20, 2016

From @FROGGS

But the shown exit of "0" would be correct, no?

I guess we want to show more information when we cannot compile the test scripts using the compiler we guessed....

@p6rt
Copy link
Author

p6rt commented Jan 20, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 20, 2016

From @stmuk

My guess is that the PPC version of OS X probably still has the real
GCC as its compiler rather than clang as on more modern systems.

You could try looking for the config line which contains the definiton
of clang for OS X/darwin and changing it to gcc or if you are using
rakudobrew maybe something like

rakudobrew build moar --configure-opts=--moar-option=--cc=gcc

might work?

On 18 January 2016 at 17​:26, James E Keenan
<perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by James E Keenan
# Please include the string​: [perl #​127308]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127308 >

Today I tried for the first time to build Perl 6 from source -- specifically Rakudo Star 2015.11 -- on my older Darwin/PPC. (I first tried to do so with 'rakudobrew', but that utility apparently has dependencies on more recent versions of 'git' than I can install on this machine.) Configuration failed -- but at a point so early in the process that I was surprised.

Here is what I called and got​:

##########
[rakudo] 545 $ cd rakudo-star-2015.11
[rakudo-star-2015.11] 546 $ perl Configure.pl --backend=moar --gen-moar
ATTENTION​: no --prefix supplied, building and installing to /Users/jimk/rakudo/rakudo-star-2015.11/install

Configuring and building MoarVM ...
perl Configure.pl --optimize --prefix=/Users/jimk/rakudo/rakudo-star-2015.11/install --make-install
Welcome to MoarVM!

Configuring native build environment ................... OK
probing whether your compiler thinks that it is gcc Can't compile simple gcc probe, so something is badly wrong at build/probe.pm line 92.
Command failed (status 32512)​: perl Configure.pl --optimize --prefix=/Users/jimk/rakudo/rakudo-star-2015.11/install --make-install
##########

Well, my compiler is definitely gcc. It's still capable of building perl-5.22.1 from source. I examined ./MoarVM/build/probe.pm and just above that point I saw C code to detect a C compiler. I extracted it, compiled it and ran it.

##########

$ cat try.c
#include <stdlib.h>

int main(int argc, char **argv) {
#ifdef __GNUC__
return EXIT_SUCCESS;
#else
return EXIT_FAILURE;
#endif
}

$ gcc -o try try.c

$ perl -e '$rv = system(qq{./try}); print "<$rv>\n";'
<0>
##########

So the C probe works by itself, but the program in which it is embedded fails. Any ideas?

Thank you very much.
Jim Keenan
--
James E Keenan (jkeenan@​cpan.org)
Summary of my perl5 (revision 5 version 22 subversion 1) configuration​:

Platform​:
osname=darwin, osvers=8.11.0, archname=darwin-2level
uname='darwin macintosh-9.local 8.11.0 darwin kernel version 8.11.0​: wed oct 10 18​:26​:00 pdt 2007; root​:xnu-792.24.17~1release_ppc power macintosh powerpc '
config_args='-des'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -I/usr/local/include -I/opt/local/include -D_FORTIFY_SOURCE=2',
optimize='-O3',
cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -I/usr/local/include -I/opt/local/include'
ccversion='', gccversion='4.0.1 (Apple Computer, Inc. build 5250)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321, doublekind=4
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=6
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries​:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -L/usr/local/lib -L/opt/local/lib'
libpth=/usr/local/lib /usr/lib /opt/local/lib
libs=-lpthread -ldbm -ldl -lm -lc
perllibs=-lpthread -ldl -lm -lc
libc=, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib'

Characteristics of this binary (from libperl)​:
Compile-time options​: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP
PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME
USE_PERLIO USE_PERL_ATOF
Built under darwin
Compiled at Dec 13 2015 21​:51​:07
%ENV​:
PERLBREW_BASHRC_VERSION="0.59"
PERLBREW_HOME="/Users/jimk/.perlbrew"
PERLBREW_ROOT="/Users/jimk/perl5/perlbrew"
PERL_WORKDIR="gitwork/perl"
@​INC​:
/usr/local/lib/perl5/site_perl/5.22.1/darwin-2level
/usr/local/lib/perl5/site_perl/5.22.1
/usr/local/lib/perl5/5.22.1/darwin-2level
/usr/local/lib/perl5/5.22.1
/usr/local/lib/perl5/site_perl/5.20.1
/usr/local/lib/perl5/site_perl/5.20.0
/usr/local/lib/perl5/site_perl/5.18.0
/usr/local/lib/perl5/site_perl/5.16.0
/usr/local/lib/perl5/site_perl/5.14.2
/usr/local/lib/perl5/site_perl/5.14.0
/usr/local/lib/perl5/site_perl/5.12.0
/usr/local/lib/perl5/site_perl/5.10.1
/usr/local/lib/perl5/site_perl/5.10.0
/usr/local/lib/perl5/site_perl/5.8.6
/usr/local/lib/perl5/site_perl
.

--
4096R/EA75174B Steve Mynott <steve.mynott@​gmail.com>

@p6rt
Copy link
Author

p6rt commented Jan 21, 2016

From @geekosaur

On Wed, Jan 20, 2016 at 11​:37 AM, Steve Mynott <steve.mynott@​gmail.com>
wrote​:

My guess is that the PPC version of OS X probably still has the real
GCC as its compiler rather than clang as on more modern systems.

This will also be true of Intel-based Macs with Xcode 3.x or earlier
(roughly OS X 10.6 and earlier).

--
brandon s allbery kf8nh sine nomine associates
allbery.b@​gmail.com ballbery@​sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

@p6rt
Copy link
Author

p6rt commented Jan 21, 2016

From @jkeenan

On Wed Jan 20 15​:56​:27 2016, steve.mynott@​gmail.com wrote​:

My guess is that the PPC version of OS X probably still has the real
GCC as its compiler rather than clang as on more modern systems.

You could try looking for the config line which contains the definiton
of clang for OS X/darwin and changing it to gcc or if you are using
rakudobrew maybe something like

rakudobrew build moar --configure-opts=--moar-option=--cc=gcc

might work?

Unfortunately, that did not work. As I noted in my OP, it appears that rakudobrew is hard-wired to expect certain functionality in 'git' that is only found in versions of 'git' more recent than I can install on this machine. See attachment.

I then tried manual configuration. I tried 'perl Configure.pl --backend-moar --gen-moar' with various combinations of things like '--cc=gcc --link=gcc --ld=gcc'. Back when Rakudo was built on Parrot, those command-line switches would have been meaningful. But in this case I got no farther than Configure.pl's 'help' message. I inspected the code in Configure.pl and didn't see anything that suggested one could choose among compilers for those switches.

So it appears that Rakudo on moar is not buildable on this platform.

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p6rt
Copy link
Author

p6rt commented Jan 21, 2016

From @jkeenan

Script started on Wed Jan 20 20​:41​:16 2016
775271dfa9354bc97713f0d30d6ffed33a3e763a

HEAD is now at 775271d... rename s/outdent/de-indent/

ATTENTION​: no --prefix supplied, building and installing to /Users/jimk/.rakudobrew/moar-nom/install

sh​: line 1​: /Users/jimk/.rakudobrew/moar-nom/install/bin/nqp-m​: No such file or directory

Initialized empty Git repository in /Users/jimk/.rakudobrew/moar-nom/nqp/.git/

fatal​: https://github.com/perl6/nqp.git/info/refs download error - Protocol https not supported or disabled in libcurl

Command failed (status 32768)​: git clone --reference=/Users/jimk/.rakudobrew/bin/../git_reference/nqp https://github.com/perl6/nqp.git nqp

Failed running perl Configure.pl --backends=moar --gen-moar --git-reference=/Users/jimk/.rakudobrew/bin/../git_reference --make-install --moar-option=--cc=gcc at /Users/jimk/.rakudobrew/bin/rakudobrew line 58.

  main​::run("perl Configure.pl --backends=moar --gen-moar --git-reference="...) called at /Users/jimk/.rakudobrew/bin/rakudobrew line 378

  main​::build_impl("moar", undef, "--moar-option=--cc=gcc") called at /Users/jimk/.rakudobrew/bin/rakudobrew line 114

@p6rt
Copy link
Author

p6rt commented Jan 21, 2016

From @FROGGS

Can't we do something like this[^1] on darwin also?

[^1] https://github.com/MoarVM/MoarVM/blob/master/build/setup.pm#L445

Like, checking for the existance of clang, and falling back to gcc?

@p6rt
Copy link
Author

p6rt commented Jan 21, 2016

From @geekosaur

On Thu, Jan 21, 2016 at 2​:29 PM, Tobias Leich via RT <
perl6-bugs-followup@​perl.org> wrote​:

Can't we do something like this[^1] on darwin also?

[^1] https://github.com/MoarVM/MoarVM/blob/master/build/setup.pm#L445

Like, checking for the existance of clang, and falling back to gcc?

gcc and llvm-gcc-4.2 are symlinks to clang in later versions of xcode, so
that should work.

--
brandon s allbery kf8nh sine nomine associates
allbery.b@​gmail.com ballbery@​sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

@p6rt
Copy link
Author

p6rt commented Jan 21, 2016

From @FROGGS

Does that mean that we *always always always* have a gcc binary?

@p6rt p6rt added the build label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant