develooper Front page | perl.perl5.porters | Postings from November 2014

[perl #123304] Perl v5.20.1 fails to build

Thread Previous
From:
Father Chrysostomos via RT
Date:
November 26, 2014 20:41
Subject:
[perl #123304] Perl v5.20.1 fails to build
Message ID:
rt-4.0.18-12075-1417034484-917.123304-15-0@perl.org
On Wed Nov 26 05:59:27 2014, hafen.mccormick@gmail.com wrote:
> Hello,
> 
> I am attempting to build and install Perl v5.20.1 on OS X 10.6.8, but
> it is failing to build.
> 
> I'm configuring with:
> ./Configure -Dprefix=/opt/local/
> 
> I then run make, and everything proceeds smoothly until I see this:
> 
> gcc-mp-4.6 -c   -fno-common -DPERL_DARWIN -fwrapv -fno-strict-aliasing
> -pipe -fstack-protector -I/opt/local/include -I/usr/local/include
> -DDEBUGGING -O3   -DVERSION=\"1.25\" -DXS_VERSION=\"1.25\"  "-I../.."
> -DLIBC="" DynaLoader.c
> DynaLoader.c: In function 'boot_DynaLoader':
> DynaLoader.c:535:5: error: expected ')' before numeric constant
> make[1]: *** [DynaLoader.o] Error 1
> Unsuccessful make(ext/DynaLoader): code=512 at make_ext.pl line 561.
> make: *** [DynaLoader.o] Error 25
> 
> The offending line is this:
> 
> XS_VERSION_BOOTCHECK;
> 
> which is a macro, defined in XSUB.h:
> 
> #ifdef XS_VERSION
> #  define XS_VERSION_BOOTCHECK
> \
>     Perl_xs_version_bootcheck(aTHX_ items, ax,
> STR_WITH_LEN(XS_VERSION))
> #else
> #  define XS_VERSION_BOOTCHECK
> #endif
> 
> The STR_WITH_LEN macro is defined in handy.h:
> 
> /* concatenating with "" ensures that only literal strings are
> accepted as
>  * argument */
> #define STR_WITH_LEN(s)  ("" s ""), (sizeof(s)-1)
> 
> /* note that STR_WITH_LEN() can't be used as argument to macros or
> functions
>  * that under some configurations might be macros, which means that it
> requires
>  * the full Perl_xxx(aTHX_ ...) form for any API calls where it's
> used.
>  */
> 
> Running only the pre-processor on Dynaloader.c, the offending line
> appears as:
> 
> Perl_xs_version_bootcheck(my_perl, items, ax, ("" 1.25 ""),
> (sizeof(1.25)-1));
> 
> Do you have any idea what could be going wrong here or how to fix it?

It looks as though STR_WITH_LEN needs to be defined a little differently.  If you change it to:

#define STR_WITH_LEN(s)  ("" s ""), (sizeof("" s "")-1)

does the problem go away?

And is this a general problem with gcc 4.6?

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=123304

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About