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

Perl 5.8.8 does not compile on Solaris 8 with -Dusethreads #8929

Closed
p5pRT opened this issue Jun 14, 2007 · 8 comments
Closed

Perl 5.8.8 does not compile on Solaris 8 with -Dusethreads #8929

p5pRT opened this issue Jun 14, 2007 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 14, 2007

Migrated from rt.perl.org#43216 (status was 'resolved')

Searchable as RT43216$

@p5pRT
Copy link
Author

p5pRT commented Jun 14, 2007

From jaevans@clearcase.mdconsult.com

Created by jaevans@clearcase.mdconsult.com

This is a bug report for perl from jaevans@​clearcase.mdconsult.com,
generated with the help of perlbug 1.35 running under perl v5.8.8.

-----------------------------------------------------------------
Compiling perl-5.8.8 witch gcc under Solaris 8 with -Dusethreads failes with the message​:

  Making DynaLoader (static)
Writing Makefile for DynaLoader
make[1]​: Entering directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
make[1]​: Leaving directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
make[1]​: Entering directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
../../miniperl "-I../../lib" "-I../../lib" DynaLoader_pm.PL DynaLoader.pm
../../miniperl "-I../../lib" "-I../../lib" XSLoader_pm.PL XSLoader.pm
Skip ../../lib/XSLoader.pm (unchanged)
Skip ../../lib/DynaLoader.pm (unchanged)
make[1]​: Leaving directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
gcc -o perl -L/usr/local/lib perlmain.o lib/auto/DynaLoader/DynaLoader.a libperl.a `cat ext.libs` -lsocket -lnsl -ldl -lm -lpthread -lc
gcc​: lib/auto/DynaLoader/DynaLoader.a​: No such file or directory
make​: *** [perl] Error 1

The only change from the configuration below is the inclusion of -Dusethreads to the config_args

Perl Info

Flags:
    category=install
    severity=high

Site configuration information for perl v5.8.8:

Configured by jaevans at Wed Jun 13 08:24:40 CDT 2007.

Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
  Platform:
    osname=solaris, osvers=2.8, archname=sun4-solaris
    uname='sunos clearcase 5.8 generic_117350-45 sun4u sparc sunw,ultra-60 '
    config_args='-Dprefix=/export/home/mdc -Dperladmin=none -Dpage=/usr/bin/more -Uinstallusrbinperl -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include'
    ccversion='', gccversion='3.4.2', gccosandvers='solaris2.8'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib '
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches:
    


@INC for perl v5.8.8:
    /export/home/mdc/lib/perl5/5.8.8/sun4-solaris
    /export/home/mdc/lib/perl5/5.8.8
    /export/home/mdc/lib/perl5/site_perl/5.8.8/sun4-solaris
    /export/home/mdc/lib/perl5/site_perl/5.8.8
    /export/home/mdc/lib/perl5/site_perl
    /export/home/mdc/lib/perl5/5.8.8/sun4-solaris
    /export/home/mdc/lib/perl5/5.8.8
    /export/home/mdc/lib/perl5
    /export/home/mdc/lib/perl5/site_perl/5.8.8/sun4-solaris
    /export/home/mdc/lib/perl5/site_perl/5.8.8
    /export/home/mdc/lib/perl5/site_perl
    .


Environment for perl v5.8.8:
    HOME=/home/jaevans
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/oradb/app/oracle/product/9.2.0/lib:
    LOGDIR (unset)
    PATH=/export/home/mdc/bin:/oradb/app/oracle/product/9.2.0/bin:/usr/local/bin:/usr/ccs/bin:/home/jaevans/bin:/home/jaevans/custom/bin:/usr/bin::/usr/local/bin:/export/home/mdc/bin:/tools/prod/bin:/tools/admin/bin:/export/home/mdc/lib/java/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Jun 14, 2007

From @doughera88

On Thu, 14 Jun 2007, jaevans @​ clearcase . mdconsult . com wrote​:

# New Ticket Created by jaevans@​clearcase.mdconsult.com
# Please include the string​: [perl #43216]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org/rt3/Ticket/Display.html?id=43216 >

-----------------------------------------------------------------
Compiling perl-5.8.8 witch gcc under Solaris 8 with -Dusethreads failes with the message​:

    Making DynaLoader \(static\)

Writing Makefile for DynaLoader
make[1]​: Entering directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
make[1]​: Leaving directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
make[1]​: Entering directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
../../miniperl "-I../../lib" "-I../../lib" DynaLoader_pm.PL DynaLoader.pm
../../miniperl "-I../../lib" "-I../../lib" XSLoader_pm.PL XSLoader.pm
Skip ../../lib/XSLoader.pm (unchanged)
Skip ../../lib/DynaLoader.pm (unchanged)
make[1]​: Leaving directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
gcc -o perl -L/usr/local/lib perlmain.o lib/auto/DynaLoader/DynaLoader.a libperl.a `cat ext.libs` -lsocket -lnsl -ldl -lm -lpthread -lc
gcc​: lib/auto/DynaLoader/DynaLoader.a​: No such file or directory
make​: *** [perl] Error 1

I was able to compile with gcc-3.4.3 on Solaris 8 with -Dusethreads
without any trouble.

What happened the first time through? What you have reported above is
at least the second run (note how XSLoader.pm and DynaLoader.pm were
skipped as 'unchanged'). In order to see what happened, we'd need to
see what happened the first time through.

The only change from the configuration below is the inclusion of
-Dusethreads to the config_args

could you please include the output of the ./myconfig file from the
failing run?

Thanks.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags​:
category=install
severity=high
---
Site configuration information for perl v5.8.8​:

Configured by jaevans at Wed Jun 13 08​:24​:40 CDT 2007.

Summary of my perl5 (revision 5 version 8 subversion 8) configuration​:
Platform​:
osname=solaris, osvers=2.8, archname=sun4-solaris
uname='sunos clearcase 5.8 generic_117350-45 sun4u sparc sunw,ultra-60 '
config_args='-Dprefix=/export/home/mdc -Dperladmin=none -Dpage=/usr/bin/more -Uinstallusrbinperl -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='gcc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O',
cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include'
ccversion='', gccversion='3.4.2', gccosandvers='solaris2.8'
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries​:
ld='gcc', ldflags =' -L/usr/local/lib '
libpth=/usr/local/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc
perllibs=-lsocket -lnsl -ldl -lm -lc
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches​:

---
@​INC for perl v5.8.8​:
/export/home/mdc/lib/perl5/5.8.8/sun4-solaris
/export/home/mdc/lib/perl5/5.8.8
/export/home/mdc/lib/perl5/site_perl/5.8.8/sun4-solaris
/export/home/mdc/lib/perl5/site_perl/5.8.8
/export/home/mdc/lib/perl5/site_perl
/export/home/mdc/lib/perl5/5.8.8/sun4-solaris
/export/home/mdc/lib/perl5/5.8.8
/export/home/mdc/lib/perl5
/export/home/mdc/lib/perl5/site_perl/5.8.8/sun4-solaris
/export/home/mdc/lib/perl5/site_perl/5.8.8
/export/home/mdc/lib/perl5/site_perl
.

---
Environment for perl v5.8.8​:
HOME=/home/jaevans
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH=/oradb/app/oracle/product/9.2.0/lib​:
LOGDIR (unset)
PATH=/export/home/mdc/bin​:/oradb/app/oracle/product/9.2.0/bin​:/usr/local/bin​:/usr/ccs/bin​:/home/jaevans/bin​:/home/jaevans/custom/bin​:/usr/bin​::/usr/local/bin​:/export/home/mdc/bin​:/tools/prod/bin​:/tools/admin/bin​:/export/home/mdc/lib/java/bin
PERL_BADLANG (unset)
SHELL=/bin/bash

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Jun 14, 2007

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

@p5pRT
Copy link
Author

p5pRT commented Jun 15, 2007

From Ja.Evans@Elsevier.com

I was able to compile with gcc-3.4.3 on Solaris 8 with -Dusethreads
without any trouble.

What happened the first time through? What you have reported above is
at least the second run (note how XSLoader.pm and DynaLoader.pm were
skipped as 'unchanged'). In order to see what happened, we'd need to
see what happened the first time through.

Oops. I ran 'make clean' and 'make' again to get the error message to copy into perlbug. I've deleted the directory and re-did the Configure and make to get the error message again. So much for saving time with the make clean :)

Here is the output of the first run with -Dusethreads​:

  Making DynaLoader (static)
Writing Makefile for DynaLoader
make[2]​: Entering directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
make[2]​: Leaving directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
make[2]​: Entering directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
../../miniperl "-I../../lib" "-I../../lib" DynaLoader_pm.PL DynaLoader.pm
../../miniperl "-I../../lib" "-I../../lib" XSLoader_pm.PL XSLoader.pm
cp XSLoader.pm ../../lib/XSLoader.pm
cp DynaLoader.pm ../../lib/DynaLoader.pm
AutoSplitting ../../lib/DynaLoader.pm (../../lib/auto/DynaLoader)
make[2]​: Leaving directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
gcc -o perl -L/usr/local/lib perlmain.o lib/auto/DynaLoader/DynaLoader.a libperl.a `cat ext.libs` -lsocket -lnsl -ldl -lm -lpthread -lc
gcc​: lib/auto/DynaLoader/DynaLoader.a​: No such file or directory
make[1]​: *** [perl] Error 1
make[1]​: Leaving directory `/home/jaevans/perl/perl-5.8.8'
make​: *** [perl] Error 2

Here is the output of ./myconfig​:
$ ./myconfig
Summary of my perl5 (revision 5 version 8 subversion 8) configuration​:
  Platform​:
  osname=solaris, osvers=2.8, archname=sun4-solaris-thread-multi
  uname='sunos clearcase 5.8 generic_117350-45 sun4u sparc sunw,ultra-60 '
  config_args='-Dprefix=/export/home/mdc -Dusethreads -Dperladmin=none -Dpage=/usr/bin/more -Uinstallusrbinperl -des'
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
  useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
  use64bitint=undef use64bitall=undef uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='gcc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O',
  cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include'
  ccversion='', gccversion='3.4.2', gccosandvers='solaris2.8'
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='gcc', ldflags =' -L/usr/local/lib '
  libpth=/usr/local/lib /usr/lib /usr/ccs/lib
  libs=-lsocket -lnsl -ldl -lm -lpthread -lc
  perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc
  libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
  cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

For each build I'm deleting the perl-5.8.8 directory, untaring, re-configuring, and re-building. The process is controlled by a makefile, so I get the same result every time.

Thanks,

james evans

@p5pRT
Copy link
Author

p5pRT commented Jun 15, 2007

From @doughera88

On Fri, 15 Jun 2007, Evans, James (ELS) wrote​:

Here is the output of the first run with -Dusethreads​:
Making DynaLoader (static)
Writing Makefile for DynaLoader
make[2]​: Entering directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
make[2]​: Leaving directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
make[2]​: Entering directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
../../miniperl "-I../../lib" "-I../../lib" DynaLoader_pm.PL DynaLoader.pm
../../miniperl "-I../../lib" "-I../../lib" XSLoader_pm.PL XSLoader.pm
cp XSLoader.pm ../../lib/XSLoader.pm
cp DynaLoader.pm ../../lib/DynaLoader.pm
AutoSplitting ../../lib/DynaLoader.pm (../../lib/auto/DynaLoader)
make[2]​: Leaving directory `/home/jaevans/perl/perl-5.8.8/ext/DynaLoader'
gcc -o perl -L/usr/local/lib perlmain.o lib/auto/DynaLoader/DynaLoader.a libperl.a `cat ext.libs` -lsocket -lnsl -ldl -lm -lpthread -lc
gcc​: lib/auto/DynaLoader/DynaLoader.a​: No such file or directory

Ouch. Obviously, that's not supposed to happen.

$ ./myconfig
Summary of my perl5 (revision 5 version 8 subversion 8) configuration​:
Platform​:
osname=solaris, osvers=2.8, archname=sun4-solaris-thread-multi
config_args='-Dprefix=/export/home/mdc -Dusethreads -Dperladmin=none -Dpage=/usr/bin/more -Uinstallusrbinperl -des'

Compiler​:
cc='gcc', ccflags ='-fno-strict-aliasing -pipe
-Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',

Ah. I see the problem. You're missing -D_REENTRANT in the ccflags.
The second piece of the puzzle is that you are using 'gcc' but didn't
specify that on the command line. When you ran Configure, it should
have warned you​:

  Use which C compiler? [cc]
  Configure​: cc​: not found
  Uh-oh, the C compiler 'cc' doesn't seem to be working.
  Configure​: cc​: not found
  You seem to have a working gcc, though.
  Would you like to use it? [y]

  *** However, any setting of the C compiler flags (e.g. for thread support)
  *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
  *** (together with e.g. -Dusethreads).

However, it then happily continued on its way, so you probably never
noticed the warning. Configure shouldn't have continued in this case.
However, there are other cases where it worked just fine -- as you
observed in your build without threads -- and we have not solved the
general problem of detecting when it is or isn't safe to continue.

In any case, the workaround is simple​: Include -Dcc=gcc in your build
command (for both threaded and untreaded builds) builds.

Please let us know if this solves the problem.

Thanks,

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Jun 15, 2007

@doughera88 - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this as completed Jun 15, 2007
@p5pRT
Copy link
Author

p5pRT commented Jun 15, 2007

From @doughera88

On Fri, 15 Jun 2007, Andy Dougherty wrote​:

Ah. I see the problem. You're missing -D_REENTRANT in the ccflags.
The second piece of the puzzle is that you are using 'gcc' but didn't
specify that on the command line. When you ran Configure, it should
have warned you​:

Use which C compiler? \[cc\]
Configure&#8203;: cc&#8203;: not found
Uh\-oh\, the C compiler 'cc' doesn't seem to be working\.
Configure&#8203;: cc&#8203;: not found
You seem to have a working gcc\, though\.
Would you like to use it? \[y\]

\*\*\* However\, any setting of the C compiler flags \(e\.g\. for thread support\)
\*\*\* has been lost\.  It may be necessary to pass \-Dcc=gcc to Configure
\*\*\* \(together with e\.g\. \-Dusethreads\)\.

However, it then happily continued on its way, so you probably never
noticed the warning. Configure shouldn't have continued in this case.
However, there are other cases where it worked just fine -- as you
observed in your build without threads -- and we have not solved the
general problem of detecting when it is or isn't safe to continue.

Perhaps it would be better to split the trygcc script into its own
metaconfig unit. This unit would be required by the cc.U unit. However,
since it can come after the usethreads unit, it could depend on the actual
value of $usethreads, not just on the existence of the usethreads hint
call-back unit.

However, that was too much metaconfig fiddling for me today, so I just
went with this simpler patch. It simply switches the default to 'n'.
This will needlessly abort in a few cases, but will correctly abort in
others. In all cases, following the advice in the INSTALL file and
running C<sh Configure -Dcc=gcc> will do the right thing.

Inline Patch
--- metaconfig-20070423/U/perl/Checkcc.U	2007-01-16 11:33:37.000000000 -0500
+++ metaconfig-andy/U/perl/Checkcc.U	2007-06-15 11:32:36.000000000 -0400
@@ -53,15 +53,36 @@
         case "$cc" in
         *gcc*) trygcc=no ;;
         esac
-        case "`$cc -v -c try.c 2>&1`" in
-        *gcc*) trygcc=no ;;
-        esac
+	# Skip this test because it gives a false match on output like:
+	#    ./trygcc: line 23: cc: command not found
+        # case "`$cc -v -c try.c 2>&1`" in
+        # *gcc*) trygcc=no ;;
+        # esac
         if $test X"$trygcc" = Xyes; then
             if gcc -o try -c try.c; then
                 echo " "
                 echo "You seem to have a working gcc, though." >&4
-                rp="Would you like to use it?"
-                dflt=y
+		# Switching compilers may undo the work of hints files.
+		# The most common problem is -D_REENTRANT for threads.
+		# This heuristic catches that case, but gets false positives
+		# if -Dusethreads was not actually specified.  Better to
+		# bail out here with a useful message than fail 
+		# mysteriously later. Should we perhaps just try to
+		# re-invoke Configure -Dcc=gcc config_args ?
+		if $test -f usethreads.cbu; then
+			$cat >&4 <<EOM 
+
+*** However, any setting of the C compiler flags (e.g. for thread support)
+*** will be lost.  It may be necessary for you to restart Configure and
+*** add -Dcc=gcc to your Configure command line.
+
+EOM
+			rp="Would you like to go ahead and try gcc anyway?"
+			dflt=n
+		else
+			rp="Would you like to use it?"
+			dflt=y
+		fi
                 if $test -f myread; then
                     . ./myread
                 else
@@ -74,15 +95,6 @@
                 fi  
                 case "$ans" in
                 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
-                       if $test -f usethreads.cbu; then
-                           $cat >&4 <<EOM 
-
-*** However, any setting of the C compiler flags (e.g. for thread support)
-*** has been lost.  It may be necessary to pass -Dcc=gcc to Configure
-*** (together with e.g. -Dusethreads).
-
-EOM
-                       fi;;
                 esac
             fi
         fi

-- 

  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Jun 16, 2007

From @Tux

On Fri, 15 Jun 2007 12​:05​:36 -0400 (EDT), Andy Dougherty
<doughera@​lafayette.edu> wrote​:

On Fri, 15 Jun 2007, Andy Dougherty wrote​:

Ah. I see the problem. You're missing -D_REENTRANT in the ccflags.
The second piece of the puzzle is that you are using 'gcc' but didn't
specify that on the command line. When you ran Configure, it should
have warned you​:

Use which C compiler? \[cc\]
Configure&#8203;: cc&#8203;: not found
Uh\-oh\, the C compiler 'cc' doesn't seem to be working\.
Configure&#8203;: cc&#8203;: not found
You seem to have a working gcc\, though\.
Would you like to use it? \[y\]

\*\*\* However\, any setting of the C compiler flags \(e\.g\. for thread support\)
\*\*\* has been lost\.  It may be necessary to pass \-Dcc=gcc to Configure
\*\*\* \(together with e\.g\. \-Dusethreads\)\.

However, it then happily continued on its way, so you probably never
noticed the warning. Configure shouldn't have continued in this case.
However, there are other cases where it worked just fine -- as you
observed in your build without threads -- and we have not solved the
general problem of detecting when it is or isn't safe to continue.

Perhaps it would be better to split the trygcc script into its own
metaconfig unit. This unit would be required by the cc.U unit. However,
since it can come after the usethreads unit, it could depend on the actual
value of $usethreads, not just on the existence of the usethreads hint
call-back unit.

However, that was too much metaconfig fiddling for me today, so I just
went with this simpler patch. It simply switches the default to 'n'.
This will needlessly abort in a few cases, but will correctly abort in
others. In all cases, following the advice in the INSTALL file and
running C<sh Configure -Dcc=gcc> will do the right thing.

Thanks, applied as changes #31394 and #31395

--- metaconfig-20070423/U/perl/Checkcc.U 2007-01-16 11​:33​:37.000000000 -0500
+++ metaconfig-andy/U/perl/Checkcc.U 2007-06-15 11​:32​:36.000000000 -0400
@​@​ -53,15 +53,36 @​@​
case "$cc" in
*gcc*) trygcc=no ;;
esac
- case "`$cc -v -c try.c 2>&1`" in
- *gcc*) trygcc=no ;;
- esac
+ # Skip this test because it gives a false match on output like​:
+ # ./trygcc​: line 23​: cc​: command not found
+ # case "`$cc -v -c try.c 2>&1`" in
+ # *gcc*) trygcc=no ;;
+ # esac
if $test X"$trygcc" = Xyes; then
if gcc -o try -c try.c; then
echo " "
echo "You seem to have a working gcc, though." >&4
- rp="Would you like to use it?"
- dflt=y
+ # Switching compilers may undo the work of hints files.
+ # The most common problem is -D_REENTRANT for threads.
+ # This heuristic catches that case, but gets false positives
+ # if -Dusethreads was not actually specified. Better to
+ # bail out here with a useful message than fail
+ # mysteriously later. Should we perhaps just try to
+ # re-invoke Configure -Dcc=gcc config_args ?
+ if $test -f usethreads.cbu; then
+ $cat >&4 <<EOM
+
+*** However, any setting of the C compiler flags (e.g. for thread support)
+*** will be lost. It may be necessary for you to restart Configure and
+*** add -Dcc=gcc to your Configure command line.
+
+EOM
+ rp="Would you like to go ahead and try gcc anyway?"
+ dflt=n
+ else
+ rp="Would you like to use it?"
+ dflt=y
+ fi
if $test -f myread; then
. ./myread
else
@​@​ -74,15 +95,6 @​@​
fi
case "$ans" in
[yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
- if $test -f usethreads.cbu; then
- $cat >&4 <<EOM
-
-*** However, any setting of the C compiler flags (e.g. for thread support)
-*** has been lost. It may be necessary to pass -Dcc=gcc to Configure
-*** (together with e.g. -Dusethreads).
-
-EOM
- fi;;
esac
fi
fi

--
H.Merijn Brand Amsterdam Perl Mongers (http​://amsterdam.pm.org/)
using & porting perl 5.6.2, 5.8.x, 5.9.x on HP-UX 10.20, 11.00, 11.11,
& 11.23, SuSE 10.0 & 10.2, AIX 4.3 & 5.2, and Cygwin. http​://qa.perl.org
http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org
  http​://www.goldmark.org/jeff/stupid-disclaimers/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant