Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with -Dcc=c++ on FreeBSD builds a static perl #14868

Closed
p5pRT opened this issue Aug 24, 2015 · 5 comments
Closed

Build with -Dcc=c++ on FreeBSD builds a static perl #14868

p5pRT opened this issue Aug 24, 2015 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 24, 2015

Migrated from rt.perl.org#125880 (status was 'resolved')

Searchable as RT125880$

@p5pRT
Copy link
Author

p5pRT commented Aug 24, 2015

From @bingos

Using -Dcc=c++ on FreeBSD 10.2-RELEASE produces a perl without dynamic loading.

I went through the Configure dialogues by hand and prompting [n] when asking if one wishes to use dynamic loading.

c++ on FreeBSD is Clang

$ c++ -v
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target​: x86_64-unknown-freebsd10.2
Thread model​: posix
Selected GCC installation​:

I ran Configure using ktrace and found the following error when it was trying to find dlopen

try-b77b54.o​: relocation R_X86_64_32 against `dlopen' can not be used when making a shared object; recompile with -fPIC"

So -fPIC is needed as well as -shared is my guess.

Summary of my perl5 (revision 5 version 22 subversion 0) configuration​:

  Platform​:
  osname=freebsd, osvers=10.2-release, archname=amd64-freebsd
  uname='freebsd canker 10.2-release freebsd 10.2-release #0 r286666​: wed aug 12 15​:26​:37 utc 2015 root@​releng1.nyi.freebsd.org​:usrobjusrsrcsysgeneric amd64 '
  config_args='-des -Uinstallusrbinperl -Dprefix=/opt/perl-5.22.0++ -Dcc=c++'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  use64bitint=define, use64bitall=define, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='c++', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2',
  optimize='-O',
  cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include'
  ccversion='', gccversion='4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)', gccosandvers=''
  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
  ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='ld', ldflags ='-Wl,-E -L/usr/local/lib'
  libpth=/usr/lib /usr/local/lib /usr/include/c++/v1 /usr/include/clang/3.4.1 /usr/lib
  libs=-lpthread -lgdbm -lm -lcrypt -lutil -lc
  perllibs=-lpthread -lgdbm -lm -lcrypt -lutil -lc
  libc=, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_none.xs, dlext=none, d_dlsymun=undef, ccdlflags=''
  cccdlflags='-DPIC -fPIC', lddlflags=''

Characteristics of this binary (from libperl)​:
  Compile-time options​: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV
  PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP
  PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
  USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES
  USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
  USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO
  USE_PERL_ATOF
  Built under freebsd
  Compiled at Aug 20 2015 18​:30​:42
  @​INC​:
  /opt/perl-5.22.0++/lib/site_perl/5.22.0/amd64-freebsd
  /opt/perl-5.22.0++/lib/site_perl/5.22.0
  /opt/perl-5.22.0++/lib/5.22.0/amd64-freebsd
  /opt/perl-5.22.0++/lib/5.22.0

@p5pRT
Copy link
Author

p5pRT commented Aug 24, 2015

From vano@mail.mipt.ru

Using -Dcc=c++ on FreeBSD 10.2-RELEASE produces a perl without dynamic loading.

I went through the Configure dialogues by hand and prompting [n]
when asking if one wishes to use dynamic loading.

c++ on FreeBSD is Clang

$ c++ -v
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target​: x86_64-unknown-freebsd10.2
Thread model​: posix
Selected GCC installation​:

I ran Configure using ktrace and found the following error when it was trying to find dlopen

try-b77b54.o​: relocation R_X86_64_32 against `dlopen' can not be
used when making a shared object; recompile with -fPIC"

So -fPIC is needed as well as -shared is my guess.

Not a bug. Configure cannot guess flags for every random
compiler/linker, it's only supposed to provide correct defaults for
those specified in `hints/<OS>.sh'.
(It doesn't guess them at all. They are
right there in the hints, too).

If you need anything different, you need to specify them by hand
with -Dccflags or -Dldflags/-Dlddlflags
or in the corresponding question in interactive mode.

--
Regards,
Ivan Pozdeev

@p5pRT
Copy link
Author

p5pRT commented Aug 24, 2015

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Feb 15, 2016

From @bingos

This was fixed by http​://perl5.git.perl.org/perl.git/commitdiff/f8fbb01c4686d7e4393ba90b2e1326e9536d9107

@p5pRT
Copy link
Author

p5pRT commented Feb 15, 2016

@bingos - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant