A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Perl/perl5/issues/17381 below:

build-time failures using g++ as C-compiler · Issue #17381 · Perl/perl5 · GitHub

Today I ran a smoke-test of Perl 5 blead in a NetBSD-8.0 VM using g++ as the C-compiler. make failed to complete. To the best of my recollection, I have never previously tested perl on this platform with that C-compiler. However, until June of this year Carlos Guevara was testing on NetBSD-8.0 and consistently got build-time failures with g++ (g++ (nb2 20180327) 5.5.0). But he upgraded that VM to NetBSD-8.1 in June and on that version of the OS compiling perl with g++ no longer displayed build-time failures.

If we had been testing on NetBSD, say, in 2015 when g++-5.5.0 became available, we would have discovered that this build-time failure goes back a year earlier. Bisection with this invocation:

perl Porting/bisect.pl \
-Dcc=g++ \
--test-build \
--start=v5.21.6 \
--end=v5.21.7

... points to this commit:

6d59e610a3f269be73ffea56a90d1cd7dc8bf2fd is the first bad commit
commit 6d59e610a3f269be73ffea56a90d1cd7dc8bf2fd
Author: Lukas Mai <l.mai@web.de>
Date:   Sat Nov 29 12:17:05 2014 +0100
Commit:     Father Chrysostomos <sprout@cpan.org>
CommitDate: Sat Nov 29 06:11:08 2014 -0800

    define and use STATIC_ASSERT_STMT for compile-time invariants

 op.c     |  2 +-
 perl.h   | 26 +++++++++++++++++++++++++-
 pp.c     |  2 +-
 pp_hot.c |  2 +-
 pp_sys.c |  6 +++---
 sv.c     |  8 ++++----
 toke.c   |  2 +-
 7 files changed, 36 insertions(+), 12 deletions(-)

At the breaking commit (commit 6d59e61), make fails with this output:

$ zcat make.netbsd.g++.6d59e610a3.output.txt.gz
echo @`sh  cflags "optimize='-O'" perlmini.o`  -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB perlmini.c
@g++ -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/pkg/include -ansi -O -Wall -Werror=declaration-after-statement -Wextra -Wwrite-strings -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB perlmini.c
echo @`sh  cflags "optimize='-O'" opmini.o`  -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
@g++ -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/pkg/include -ansi -O -Wall -Werror=declaration-after-statement -Wextra -Wwrite-strings -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
g++ -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/pkg/include -ansi -O -Wall -Werror=declaration-after-statement -Wextra -Wwrite-strings miniperlmain.c
g++ -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/pkg/include -ansi -O -Wall -Werror=declaration-after-statement -Wextra -Wwrite-strings gv.c
g++ -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/pkg/include -ansi -O -Wall -Werror=declaration-after-statement -Wextra -Wwrite-strings toke.c
In file included from toke.c:40:0:
toke.c: In function 'void Perl_lex_start(SV*, PerlIOl**, U32)':
perl.h:3508:63: error: '_Static_assert' was not declared in this scope
 #  define STATIC_ASSERT_GLOBAL(COND) static_assert(COND, #COND)
                                                               ^
perl.h:3524:44: note: in expansion of macro 'STATIC_ASSERT_GLOBAL'
 #define STATIC_ASSERT_STMT(COND)      do { STATIC_ASSERT_GLOBAL(COND); } while (0)
                                            ^
toke.c:733:5: note: in expansion of macro 'STATIC_ASSERT_STMT'
     STATIC_ASSERT_STMT(FITS_IN_8_BITS(LEX_IGNORE_UTF8_HINTS|LEX_EVALBYTES
     ^
*** Error code 1

Stop.
make: stopped in /home/jkeenan/gitwork/perl

At HEAD (commit 4357af6), make fails with this output:

$ zcat make.netbsd.g++.4357af6ce6.output.txt.gz
echo @`sh  cflags "optimize='-O'" opmini.o`  -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
@g++ -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/pkg/include -D_FORTIFY_SOURCE=2 -O -Wall -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
In file included from op.c:163:0:
op.c: In function 'void S_maybe_multiconcat(OP*)':
perl.h:3645:61: error: '_Static_assert' was not declared in this scope
 #  define STATIC_ASSERT_DECL(COND) static_assert(COND, #COND)
                                                             ^
perl.h:3661:52: note: in expansion of macro 'STATIC_ASSERT_DECL'
 #define STATIC_ASSERT_STMT(COND)      STMT_START { STATIC_ASSERT_DECL(COND); } STMT_END
                                                    ^
op.c:3019:5: note: in expansion of macro 'STATIC_ASSERT_STMT'
     STATIC_ASSERT_STMT(   STRUCT_OFFSET(BINOP,    op_last)
     ^
perl.h:3645:61: error: '_Static_assert' was not declared in this scope
 #  define STATIC_ASSERT_DECL(COND) static_assert(COND, #COND)
                                                             ^
perl.h:3661:52: note: in expansion of macro 'STATIC_ASSERT_DECL'
 #define STATIC_ASSERT_STMT(COND)      STMT_START { STATIC_ASSERT_DECL(COND); } STMT_END
                                                    ^
op.c:3021:5: note: in expansion of macro 'STATIC_ASSERT_STMT'
     STATIC_ASSERT_STMT(   STRUCT_OFFSET(LISTOP,   op_last)
     ^
op.c: In function 'OP* S_pmtrans(OP*, OP*, OP*)':
perl.h:3645:61: error: '_Static_assert' was not declared in this scope
 #  define STATIC_ASSERT_DECL(COND) static_assert(COND, #COND)
                                                             ^
op.c:7782:13: note: in expansion of macro 'STATIC_ASSERT_DECL'
             STATIC_ASSERT_DECL(TR_SPECIAL_HANDLING == TR_DELETE);
             ^
op.c: In function 'void Perl_rpeep(OP*)':
perl.h:3645:61: error: '_Static_assert' was not declared in this scope
 #  define STATIC_ASSERT_DECL(COND) static_assert(COND, #COND)
                                                             ^
perl.h:3661:52: note: in expansion of macro 'STATIC_ASSERT_DECL'
 #define STATIC_ASSERT_STMT(COND)      STMT_START { STATIC_ASSERT_DECL(COND); } STMT_END
                                                    ^
op.c:16980:21: note: in expansion of macro 'STATIC_ASSERT_STMT'
                     STATIC_ASSERT_STMT(sizeof(OP) <= sizeof(BINOP));
                     ^
*** Error code 1

Stop.
make: stopped in /home/jkeenan/gitwork/perl

The default C-compiler on NetBSD-8.0 is gcc-5.5.0. I have no idea what importance g++ has on NetBSD, nor do I know why these build-time failures seem to be OS-version-specific. But if anyone can spot the flaw, it would help make our coding more precise.

Thank you very much.
Jim Keenan

@cpansprout @cguevara


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4