flynn7312 has asked for the wisdom of the Perl Monks concerning the following question:

dear monks, i am in the process of doing a gcc build of Perl, but it wont let me through. A build with IBM's native xlc compiler is going well, but in this case gcc is necessary to not break the AIX freeware tree.

here ist the error in his full glory.

+ make echo @`sh cflags "optimize='-O2 -g '" opmini.o` -DPERL_IS_MI +NIPERL -DPERL_EXTERNAL_GLOB opmini.c @/usr/bin/gcc -maix32 -maix32 -c -DPERL_CORE -D_THREAD_SAFE -D_ALL_SOU +RCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -DNEED_PTHRE +AD_INIT -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LA +RGE_FILES -O2 -g -Wall -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini +.c In file included from op.h:636:0, from perl.h:3903, from op.c:103: reentr.h:719:14: error: field '_spent_struct' has incomplete type struct spwd _spent_struct; ^~~~~~~~~~~~~ make: The error code from the last command is 1.

the configure options

export OBJECT_MODE=32 export CC='/usr/bin/gcc -maix32' export LDFLAGS="-s -Wl,-bmaxdata:0x80000000 -L/opt/freeware/lib -L/usr +/lib" ./Configure -desr -Doptimize="$RPM_OPT_FLAGS" \ -d \ -Dcc="$CC" -Dldflags="$LDFLAGS" \ -Dinstallprefix=$RPM_BUILD_ROOT%{_prefix} \ -Dprefix=%{_prefix} \ -Duselargefiles \ -Duseshrplib \ -Dusethreads \ -Darchname=%{_arch}-%{_os} \ -A define:ld='/usr/bin/gcc -maix32' \ -A define:ccdlflags='-brtl -bdynamic' \ -A define:lddlflags='-bexpall -G -L/opt/freeware/lib' make #make test ( make -k check || true ) # build 64bit mode export OBJECT_MODE=64 cd 64bit export CC='/usr/bin/gcc -maix64' export LDFLAGS="-s -Wl,-bmaxdata:0x80000000 -L/opt/freeware/lib64 -L/u +sr/lib64 -L/opt/freeware/lib" ./Configure -desr -Doptimize="$RPM_OPT_FLAGS" \ -d \ -Dcc="$CC" -Dldflags="$LDFLAGS" \ -Dinstallprefix=$RPM_BUILD_ROOT%{_prefix} \ -Dprefix=%{_prefix} \ -Duselargefiles \ -Duseshrplib \ -Dusethreads \ -Duse64bitall \ -Darchname=%{_arch}-%{_os} \ -A define:ld='/usr/bin/gcc -maix64' \ -A define:ccdlflags='-brtl -bdynamic' \ -A define:lddlflags='-bexpall -G -L/opt/freeware/lib64 -L/usr +/lib64 -L/opt/freeware/lib' make
Is there any perl bugtracker where one can report this kind of errors? I dont know how to report compilation errors with perlbug.

Replies are listed 'Best First'.
Re: Perl: AIX compile error
by Tux (Canon) on Sep 28, 2017 at 11:33 UTC

    Instead of defining a zillion options to Configure, create a Policy.sh (and save it) and work from there.

    cc=gcc ccflags="-maix32 $ccflags" ...

    Enjoy, Have FUN! H.Merijn
Re: Perl: AIX compile error
by syphilis (Archbishop) on Sep 28, 2017 at 10:50 UTC
    I dont know how to report compilation errors with perlbug

    You can just send an email to perlbug at perl dot org, including the info you provided.
    Provide a suitable subject line for the email, and also mention which version of perl you're trying to build.

    Cheers,
    Rob
      Mail sent, lets see.
Re: Perl: AIX compile error
by marioroy (Prior) on Sep 29, 2017 at 00:16 UTC

    From perlaix: If you choose gcc to compile 64-bit Perl then you need to add the following option. See also, article at IBM.

    -Dcc='gcc -maix64'

    Update: Ah, it looks like you're wanting to build a 32-bit Perl. Have you tried the following configure option?

    -Dcc='gcc -maix32'

    There is AIX Toolbox for Linux Applications. The AIX Toolbox for Linux Applications contains a wide variety of software, including but not limited to:

    - Application Development - gcc, g++, gdb, rpm, cvs, automake, autoconf, libtool, git, subversion, gettext - GNU base utilities - gawk, m4, indent, sed, tar, diffutils, findutils, grep, coreutils - Programming Languages - perl, python, ruby, php - System Utilities - emacs, vim, bzip2, gzip, rsync, wget, lsof, less, samba, zip, unzip - Libraries - ncurses, readline, libxml2, libyaml, libpng, libjpeg, slang, db, glib2, zlib, gtk+ - System Shells - bash, tcsh, zsh - Software Managment - YUM - Developing graphical user interface - gtk2+ - Cloud environment - cloud-init, python-swift

    With the perl binary, included with the toolbox, one can then extract the configure options used.

    /path/to/toolbox/bin/perl -V | grep config_args

    Am not sure how gcc was installed. If taken from AIXTOOLS, notice the extra step after the installation.

    /opt/libexec/gcc/powerpc-ibm-aix5.3.7.0/4.7.4/install-tools/mkheaders

    Regards, Mario

Re: Perl: AIX compile error
by Anonymous Monk on Sep 28, 2017 at 23:26 UTC

    See the man page for getspnam on your system. The struct spwd ought to be defined in <shadow.h>, but maybe it's different on AIX. Maybe you just need to pass -DI_SHADOW to gcc.