Opened 4 years ago

Closed 4 years ago

#51330 closed defect (fixed)

perl5.24.0-RC5: broken build

Reported by: mojca (Mojca Miklavec) Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: dbevans (David B. Evans)
Port: perl5.24

Description (last modified by mojca (Mojca Miklavec))

Building perl 5.24.0-RC5 in the same way as any other older Perl version breaks for me:

env MACOSX_DEPLOYMENT_TARGET=10.7 /usr/bin/clang -o libperl.dylib \
    -L/opt/local/lib -Wl,-headerpad_max_install_names \
    -arch x86_64 -fstack-protector -dynamiclib \
    -compatibility_version 5.24.0 -current_version 5.24.0 \
    -install_name /opt/local/lib/perl5/5.24/darwin-thread-multi-2level/CORE/libperl.dylib \
    op.o perl.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o DynaLoader.o \
    -lpthread -ldl -lm -lutil -lc 

Undefined symbols for architecture x86_64:
  "_environ", referenced from:
      _perl_construct in perl.o
      _S_init_postdump_symbols in perl.o
      _Perl_my_setenv in util.o
      _Perl_my_clearenv in util.o
      _Perl_init_i18nl10n in locale.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libperl.dylib] Error 1
make: *** Waiting for unfinished jobs....

Link to upstream report:

Attachments (1)

perl5.24-main.log (114.5 KB) - added by mojca (Mojca Miklavec) 4 years ago.
log of broken perl5.24.0-RC5 build

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by mojca (Mojca Miklavec)

Attachment: perl5.24-main.log added

log of broken perl5.24.0-RC5 build

comment:1 Changed 4 years ago by mojca (Mojca Miklavec)

The subport (that needs to be uncommented) has been committed in r148406.

comment:2 Changed 4 years ago by mojca (Mojca Miklavec)

Description: modified (diff)

comment:3 Changed 4 years ago by mojca (Mojca Miklavec)

From perl5240delta.pod:

Builds with both -DDEBUGGING and threading enabled would fail with a "panic: free from wrong pool" error when built or tested from Terminal on OS X. This was caused by perl's internal management of the environment conflicting with an atfork handler using the libc setenv() function to update the environment.

Perl now uses setenv()/unsetenv() to update the environment on OS X.

perl #126240

comment:4 Changed 4 years ago by mojca (Mojca Miklavec)

It seems that the problem lies in

-Dccflags="$CFLAGS"

if I remove that flag, the build succeeds and the problem #51327 remains.

I was told (and the INSTALL document hints) that one has to use

-Accflags=...

I'll have to change this for all Perl subports.

Last edited 4 years ago by mojca (Mojca Miklavec) (previous) (diff)

comment:5 in reply to:  4 Changed 4 years ago by jhi

Replying to mojca@…:

It seems that the problem lies in

-Dccflags="$CFLAGS"

if I remove that flag, the build succeeds and the problem #51327 remains.

I was told (and the INSTALL document hints) that one has to use

-Accflgas=...

-Accflags

}}} I'll have to change this for all Perl subports.

Whatever you do, you need to have -DPERL_DARWIN.

comment:6 Changed 4 years ago by mojca (Mojca Miklavec)

Running perl5.2x -V actually shows the flag -DPERL_DARWIN being present:

    cc='/usr/bin/clang', ccflags ='-pipe -Os  -fno-common -DPERL_DARWIN -I/opt/local/include -fno-strict-aliasing -fstack-protector -I/opt/local/include',
    optimize='-O3',
    cppflags='-I/opt/local/include -pipe -Os  -fno-common -DPERL_DARWIN -I/opt/local/include -fno-strict-aliasing -fstack-protector -I/opt/local/include'

Now I'm even more confused.

comment:7 Changed 4 years ago by mojca (Mojca Miklavec)

New port submitted in #51352.

comment:8 Changed 4 years ago by mojca (Mojca Miklavec)

Resolution: fixed
Status: newclosed

Not sure what to do with this ticket. I replaced the flags and now perl builds fine. It's a different question whether Perl should nevertheless build even with those flags in place ...

Note: See TracTickets for help on using tickets.