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

v5.10.0 util.c and pp_sys.c fail to compile under Mac OS X #9080

Closed
p5pRT opened this issue Oct 23, 2007 · 6 comments
Closed

v5.10.0 util.c and pp_sys.c fail to compile under Mac OS X #9080

p5pRT opened this issue Oct 23, 2007 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 23, 2007

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

Searchable as RT46725$

@p5pRT
Copy link
Author

p5pRT commented Oct 23, 2007

From @trwyant

This is a bug report for perl from wyant@​cpan.org,
generated with the help of perlbug 1.36 running under perl 5.10.0.


The 'make' step for Perl 5.10.0 DEVEL32174 fails to compile util.c
under Mac OS X 10.3.9 with the following error​:

`sh cflags "optimize='-Os'" util.o` util.c
  CCCMD = cc -DPERL_CORE -c -DPERL_PATCHNUM=32174 -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -I/usr/local/include -std=c89 -Os -Wall -ansi -W -Wendif-labels
In file included from /usr/include/libkern/OSByteOrder.h​:35,
  from /usr/include/mach/ndr.h​:93,
  from /usr/include/mach/clock_priv.h​:7,
  from /usr/include/mach/mach_interface.h​:37,
  from /usr/include/mach/mach.h​:62,
  from /usr/include/sys/event.h​:154,
  from /usr/include/sys/select.h​:71,
  from util.c​:44​:
/usr/include/libkern/ppc/OSByteOrder.h​:42​: error​: syntax error before "uint16_t"
/usr/include/libkern/ppc/OSByteOrder.h​:57​: error​: syntax error before "uint32_t"
/usr/include/libkern/ppc/OSByteOrder.h​:72​: error​: syntax error before "uint64_t"
/usr/include/libkern/ppc/OSByteOrder.h​:93​: error​: syntax error before "void"
/usr/include/libkern/ppc/OSByteOrder.h​:107​: error​: syntax error before "void"
/usr/include/libkern/ppc/OSByteOrder.h​:121​: error​: syntax error before "void"
/usr/include/libkern/ppc/OSByteOrder.h​:143​: error​: syntax error before "uint16_t"
/usr/include/libkern/ppc/OSByteOrder.h​:153​: error​: syntax error before "uint32_t"
/usr/include/libkern/ppc/OSByteOrder.h​:163​: error​: syntax error before "uint64_t"
In file included from /usr/include/mach/ndr.h​:93,
  from /usr/include/mach/clock_priv.h​:7,
  from /usr/include/mach/mach_interface.h​:37,
  from /usr/include/mach/mach.h​:62,
  from /usr/include/sys/event.h​:154,
  from /usr/include/sys/select.h​:71,
  from util.c​:44​:
/usr/include/libkern/OSByteOrder.h​:49​: error​: syntax error before "int32_t"
/usr/include/libkern/OSByteOrder.h​:105​: error​: syntax error before "uint16_t"
/usr/include/libkern/OSByteOrder.h​:115​: error​: syntax error before "uint32_t"
/usr/include/libkern/OSByteOrder.h​:125​: error​: syntax error before "uint64_t"
/usr/include/libkern/OSByteOrder.h​:137​: error​: syntax error before "void"
/usr/include/libkern/OSByteOrder.h​:148​: error​: syntax error before "void"
/usr/include/libkern/OSByteOrder.h​:159​: error​: syntax error before "void"
/usr/include/libkern/OSByteOrder.h​:172​: error​: syntax error before "uint16_t"
/usr/include/libkern/OSByteOrder.h​:182​: error​: syntax error before "uint32_t"
/usr/include/libkern/OSByteOrder.h​:192​: error​: syntax error before "uint64_t"
/usr/include/libkern/OSByteOrder.h​:204​: error​: syntax error before "void"
/usr/include/libkern/OSByteOrder.h​:215​: error​: syntax error before "void"
/usr/include/libkern/OSByteOrder.h​:226​: error​: syntax error before "void"
/usr/include/libkern/OSByteOrder.h​:245​: error​: syntax error before "uint16_t"
/usr/include/libkern/OSByteOrder.h​:254​: error​: syntax error before "uint32_t"
/usr/include/libkern/OSByteOrder.h​:263​: error​: syntax error before "uint64_t"
/usr/include/libkern/OSByteOrder.h​:292​: error​: syntax error before "uint16_t"
/usr/include/libkern/OSByteOrder.h​:301​: error​: syntax error before "uint32_t"
/usr/include/libkern/OSByteOrder.h​:310​: error​: syntax error before "uint64_t"
make​: *** [util.o] Error 1

The problem is that the various OSByteOrder.h files define (by default)
inline functions, which are disallowed both by -ansi and -std=c89. The
workaround is to compile without -ansi, and either without the -std
option, or with -std=c99.

pp_sys.c fails in the same way, because it (eventually) includes the same
header.

This may be a duplicate - I tried to send a report on this on October 19,
(on DEVEL32147) but I could never find it in rt.perl.org/perlbug, meaning
either that I didn't send it correctly or didn't look it up correctly.

I do not know what the favored response is. A look at the Changes file
says that you dropped these two options under Cygwin, but it was not
immediately obvious to me how to make this happen under Mac OS X.

Note that this is _NOT_ the current Mac OS X by any means; the current is
10.4.10, and is about to be 10.5. The output of 'uname -a' is appended
for your edification and/or amusement. Thanks.

$ uname -a
Darwin Wyants-White-iMac.local 7.9.0 Darwin Kernel Version 7.9.0​: Wed Mar 30 20​:11​:17 PST 2005; root​:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh powerpc



Flags​:
  category=install
  severity=low


Site configuration information for perl 5.10.0​:

Configured by tom at Mon Oct 22 18​:46​:15 EDT 2007.

Summary of my perl5 (revision 5 version 10 subversion 0 patch 32174) configuration​:
  Platform​:
  osname=darwin, osvers=7.9.0, archname=darwin-thread-multi-2level
  uname='darwin wyants-white-imac.local 7.9.0 darwin kernel version 7.9.0​: wed mar 30 20​:11​:17 pst 2005; root​:xnuxnu-517.12.7.obj~1release_ppc power macintosh powerpc '
  config_args=''
  hint=recommended, useposix=true, d_sigaction=define
  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='cc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -I/usr/local/include',
  optimize='-Os',
  cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -I/usr/local/include'
  ccversion='', gccversion='3.3 20030304 (Apple Computer, Inc. build 1671)', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
  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'
  libpth=/usr/local/lib /usr/lib
  libs=-ldbm -ldl -lm -lc
  perllibs=-ldl -lm -lc
  libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib'

Locally applied patches​:
  DEVEL


@​INC for perl 5.10.0​:
  /sw/lib/perl5
  /sw/lib/perl5/darwin
  /usr/local/test/perl/5.10.0/lib/5.10.0/darwin-thread-multi-2level
  /usr/local/test/perl/5.10.0/lib/5.10.0
  /usr/local/test/perl/5.10.0/lib/site_perl/5.10.0/darwin-thread-multi-2level
  /usr/local/test/perl/5.10.0/lib/site_perl/5.10.0
  .


Environment for perl 5.10.0​:
  DYLD_LIBRARY_PATH (unset)
  HOME=/Users/tom
  LANG (unset)
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/sw/bin​:/sw/sbin​:/bin​:/sbin​:/usr/local/bin​:/usr/bin​:/usr/sbin​:/Developer/Tools​:/Users/tom/Code/Tools​:/usr/X11R6/bin
  PERL5LIB=/sw/lib/perl5​:/sw/lib/perl5/darwin
  PERLPKGOPT=-noppm
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Oct 23, 2007

From @doughera88

On Mon, 22 Oct 2007, Tom Wyant wrote​:

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

The 'make' step for Perl 5.10.0 DEVEL32174 fails to compile util.c
under Mac OS X 10.3.9 with the following error​:

`sh cflags "optimize='-Os'" util.o` util.c
CCCMD = cc -DPERL_CORE -c -DPERL_PATCHNUM=32174 -fno-common
-DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe
-I/usr/local/include -std=c89 -Os -Wall -ansi -W
-Wendif-labels
In file included from /usr/include/libkern/OSByteOrder.h​:35,
from /usr/include/mach/ndr.h​:93,
from /usr/include/mach/clock_priv.h​:7,
from /usr/include/mach/mach_interface.h​:37,
from /usr/include/mach/mach.h​:62,
from /usr/include/sys/event.h​:154,
from /usr/include/sys/select.h​:71,
from util.c​:44​:
/usr/include/libkern/ppc/OSByteOrder.h​:42​: error​: syntax error before "uint16_t"
/usr/include/libkern/ppc/OSByteOrder.h​:57​: error​: syntax error before "uint32_t"
/usr/include/libkern/ppc/OSByteOrder.h​:72​: error​: syntax error before "uint64_t"

[ etc. ]

The problem is that the various OSByteOrder.h files define (by default)
inline functions, which are disallowed both by -ansi and -std=c89. The
workaround is to compile without -ansi, and either without the -std
option, or with -std=c99.

Good analysis. The -std=c89 and -ansi flags are added by cflags.SH after
Configure time. cflags.SH builds a "representative" C file that #includes
"perl.h" and a whole bunch of system files, and checks if it can be
compiled with the flags -std=c89 and -ansi (among others).

That "representative" file already tries to include <sys/select.h>, but
because of a typo, it doesn't.

This patch fixes a series of similar typos. It ought to fix it up​:

Inline Patch
diff -r -u perl-current/cflags.SH perl-andy/cflags.SH
--- perl-current/cflags.SH	2007-10-22 17:43:41.000000000 -0400
+++ perl-andy/cflags.SH	2007-10-23 08:28:18.000000000 -0400
@@ -66,31 +66,31 @@
 #ifdef I_UNISTD
 #include <unistd.h>
 #endif
-#ifdef I_SYSTYPES
+#ifdef I_SYS_TYPES
 #include <sys/types.h>
 #endif
-#ifdef I_SYSPARAM
+#ifdef I_SYS_PARAM
 #include <sys/param.h>
 #endif
-#ifdef I_SYSRESOURCE
+#ifdef I_SYS_RESOURCE
 #include <sys/resource.h>
 #endif
-#ifdef I_SYSSELECT
+#ifdef I_SYS_SELECT
 #include <sys/select.h>
 #endif
 #if defined(HAS_SOCKET) && !defined(VMS) && !defined(WIN32) /* See perl.h. */
 #include <sys/socket.h>
 #endif
-#ifdef I_SYSSTAT
+#ifdef I_SYS_STAT
 #include <sys/stat.h>
 #endif
-#ifdef I_SYSTIME
+#ifdef I_SYS_TIME
 #include <sys/time.h>
 #endif
-#ifdef I_SYSTIMES
+#ifdef I_SYS_TIMES
 #include <sys/times.h>
 #endif
-#ifdef I_SYSWAIT
+#ifdef I_SYS_WAIT
 #include <sys/wait.h>
 #endif
 /* The gcc -ansi can cause a lot of noise in Solaris because of:
@@ -139,7 +139,7 @@
        case " $ccflags " in
        *" $opt "*) ;; # Skip if already there.
        *) rm -f _cflags$_exe
-          case "`$cc $cflags $warn $opt _cflags.c -o _cflags$_exe 2>&1`" in
+          case "`$cc $cflags $warn $stdflags $opt _cflags.c -o _cflags$_exe 2>&1`" in
           *"unrecognized"*) ;;
           *"implicit declaration"*) ;; # Was something useful hidden?
           *"Invalid"*) ;;

-- 

  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Oct 23, 2007

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

@p5pRT
Copy link
Author

p5pRT commented Oct 23, 2007

From @nwc10

On Tue, Oct 23, 2007 at 08​:54​:51AM -0400, Andy Dougherty wrote​:

This patch fixes a series of similar typos. It ought to fix it up​:

Thanks, applied (change 32181)

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Oct 23, 2007

From @trwyant

On Tue Oct 23 06​:32​:19 2007, nicholas wrote​:

On Tue, Oct 23, 2007 at 08​:54​:51AM -0400, Andy Dougherty wrote​:

This patch fixes a series of similar typos. It ought to fix it up​:

Thanks, applied (change 32181)

Nicholas Clark

Confirmed. With 32181, 'make' runs without intervention, and 'make test'
without error. Thank you very much.

@p5pRT
Copy link
Author

p5pRT commented Oct 26, 2007

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

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

No branches or pull requests

1 participant