Opened 4 months ago

Closed 2 months ago

#57642 closed defect (fixed)

p5.26-http-xsheaders: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’

Reported by: ryandesign (Ryan Schmidt) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version:
Keywords: leopard Cc: kencu (Ken)
Port: p5-http-xsheaders

Description

p5.26-http-xsheaders fails to build on Leopard:

/usr/bin/gcc-4.2 -c  -I. -fno-common -DPERL_DARWIN -pipe -Os -fno-strict-aliasing -fstack-protector -I/opt/local/include -D_FORTIFY_SOURCE=2 -DPERL_USE_SAFE_PUTENV -Wall -std=c89 -arch i386 -O3   -DVERSION=\"0.400004\" -DXS_VERSION=\"0.400004\"  "-I/opt/local/lib/perl5/5.26/darwin-thread-multi-2level/CORE"   XSHeaders.c
In file included from /usr/include/string.h:148,
                 from /opt/local/lib/perl5/5.26/darwin-thread-multi-2level/CORE/perl.h:941,
                 from XSHeaders.xs:3:
/usr/include/secure/_string.h:52: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
/usr/include/secure/_string.h:63: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
/usr/include/secure/_string.h:74: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
/usr/include/secure/_string.h:85: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘char’
/usr/include/secure/_string.h:96: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘char’
/usr/include/secure/_string.h:107: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘char’
/usr/include/secure/_string.h:119: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘char’
/usr/include/secure/_string.h:130: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘char’
make: *** [XSHeaders.o] Error 1

But it builds on Snow Leopard and later.

Change History (7)

comment:1 Changed 3 months ago by dbevans (David B. Evans)

Same for p5.26-http-xscookies. Perhaps a compiler issue? I don't have a machine to test but does it build if you blacklist the older compilers

PortGroup           compiler_blacklist_versions 1.0
...
compiler.blacklist  *gcc-3.* *gcc-4.* {clang < 300}

comment:2 Changed 2 months ago by dbevans (David B. Evans)

Cc: kencu added

Perhaps @kencu can come up with a fix for this?

comment:3 Changed 2 months ago by kencu (Ken)

surprisingly, bumping the compiler up to gcc6 didn't fix this. It's coming from these constructs in /usr/include/secure/_string.h:

#define memcpy(dest, src, len)					\
  ((__darwin_obsz0 (dest) != (size_t) -1)				\
   ? __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))	\
   : __inline_memcpy_chk (dest, src, len))

static inline void *
__inline_memcpy_chk (void *__dest, const void *__src, size_t __len)
{
  return __builtin___memcpy_chk (__dest, __src, __len, __darwin_obsz0(__dest));
}

which for some reason the compiler is not liking. Turning off FORTIFY_SOURCE=2 bypasses the file, so that enables the build.

comment:4 Changed 2 months ago by kencu (Ken)

changing the c standard to c99 instead of c89 fixed it as well, with FORTIFY_SOURCE=2, so that's the right fix. Also fixed the other one.

Not too sure what's different about 10.6+ though, at the moment.

Looks like patching Makefile.PL to force c99 is the way to go, I would say, unless someone sees a more elegant solution.

comment:5 in reply to:  4 Changed 2 months ago by dbevans (David B. Evans)

Replying to kencu:

changing the c standard to c99 instead of c89 fixed it as well, with FORTIFY_SOURCE=2, so that's the right fix. Also fixed the other one.

Not too sure what's different about 10.6+ though, at the moment.

Looks like patching Makefile.PL to force c99 is the way to go, I would say, unless someone sees a more elegant solution.

LGTM, thanks for your help. Can you go ahead and commit your changes?

comment:6 Changed 2 months ago by ken-cunningham-webuse

In 82719a20edec8fb1227d6bf7ce831e8c81ff9ad6/macports-ports (master):

p5-http-xsheaders: force std=c99

see: #57642

comment:7 Changed 2 months ago by ken-cunningham-webuse

Resolution: fixed
Status: assignedclosed

In f05eb31273010f8b88070f72f01492cd091dd9b7/macports-ports (master):

p5-http-xscookies: force std=c99

closes: #57642

Note: See TracTickets for help on using tickets.