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

Configure should use the ccflags and ldflags when probing for libraries. #13676

Open
p5pRT opened this issue Mar 19, 2014 · 9 comments
Open

Configure should use the ccflags and ldflags when probing for libraries. #13676

p5pRT opened this issue Mar 19, 2014 · 9 comments
Projects

Comments

@p5pRT
Copy link

p5pRT commented Mar 19, 2014

Migrated from rt.perl.org#121469 (status was 'open')

Searchable as RT121469$

@p5pRT
Copy link
Author

p5pRT commented Mar 19, 2014

From @nwc10

Configure should use the ccflags and ldflags when probing for libraries.

Right now it doesn't. So on this current Ubuntu x86_64 machine I can build
blead no problem with ./Configure -Dusedevel -de.

But if I use

./Configure -Dusedevel -des -Accflags=-m32 -Aldflags=-m32 -Alddlflags=-shared\ -m32

then configure aborts like this​:

Checking your choice of C compiler and flags for coherency...
I've tried to compile and run the following simple program​:

#include <stdio.h>
int main() { printf("Ok\n"); return(0); }

I used the command​:

  cc -o try -O2 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -m32 -fstack-protector -L/usr/local/lib -m32 try.c -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
  ./try

and I got the following output​:

/usr/bin/ld​: cannot find -lgdbm
/usr/bin/ld​: cannot find -ldb
collect2​: error​: ld returned 1 exit status
I can't compile the test program.
(The supplied flags or libraries might be incorrect.)

You have a BIG problem. Shall I abort Configure [y]
Ok. Stopping Configure.

because the library probe returned these results​:

Checking for optional libraries...
No -lsocket.
No -linet.
Found -lnsl (shared).
No -lnm.
Found -lgdbm (shared).
No -ldbm.
Found -ldb (shared).
No -lmalloc.
Found -ldl (shared).
No -lld.
No -lsun.
Found -lm (shared).
Found -lcrypt (shared).
No -lsec.
Found -lutil (shared).
Found -lc (shared).
No -lcposix.
No -lposix.
No -lucb.
No -lBSD.
Found -lgdbm_compat (shared).

which are 64 bit libraries, and not all have a 32 bit version available.

IIRC this isn't just a Linux problem. It's also a pain on Solaris, and I think
OS X.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented May 18, 2014

From @jkeenan

On Wed Mar 19 01​:36​:53 2014, nicholas wrote​:

Configure should use the ccflags and ldflags when probing for
libraries.

Right now it doesn't. So on this current Ubuntu x86_64 machine I can
build
blead no problem with ./Configure -Dusedevel -de.

But if I use

./Configure -Dusedevel -des -Accflags=-m32 -Aldflags=-m32
-Alddlflags=-shared\ -m32

I tried this command (Linux Ubuntu 13.10), but Configure bombed out even more quickly for me than it did for you. Attaching Configure output and perl -V output.

Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented May 18, 2014

From @jkeenan

Summary of my perl5 (revision 5 version 18 subversion 2) configuration​:
 
  Platform​:
  osname=linux, osvers=3.11.0-18-generic, archname=x86_64-linux
  uname='linux zareason 3.11.0-18-generic #32-ubuntu smp tue feb 18 21​:11​:14 utc 2014 x86_64 x86_64 x86_64 gnulinux '
  config_args='-de -Dprefix=/home/jkeenan/perl5/perlbrew/perls/perl-5.18.2 -Aeval​:scriptdir=/home/jkeenan/perl5/perlbrew/perls/perl-5.18.2/bin'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  use64bitint=define, use64bitall=define, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2',
  cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.8.1', gccosandvers=''
  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib
  libs=-lnsl -ldl -lm -lcrypt -lutil -lc
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
  libc=libc-2.17.so, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.17'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
  cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

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_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_ALL
  USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE
  USE_LOCALE_COLLATE USE_LOCALE_CTYPE
  USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
  Built under linux
  Compiled at Mar 22 2014 10​:07​:22
  %ENV​:
  PERLBREW_BASHRC_VERSION="0.67"
  PERLBREW_HOME="/home/jkeenan/.perlbrew"
  PERLBREW_MANPATH="/home/jkeenan/perl5/perlbrew/perls/perl-5.18.2/man"
  PERLBREW_PATH="/home/jkeenan/perl5/perlbrew/bin​:/home/jkeenan/perl5/perlbrew/perls/perl-5.18.2/bin"
  PERLBREW_PERL="perl-5.18.2"
  PERLBREW_ROOT="/home/jkeenan/perl5/perlbrew"
  PERLBREW_VERSION="0.67"
  @​INC​:
  /home/jkeenan/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/x86_64-linux
  /home/jkeenan/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2
  /home/jkeenan/perl5/perlbrew/perls/perl-5.18.2/lib/5.18.2/x86_64-linux
  /home/jkeenan/perl5/perlbrew/perls/perl-5.18.2/lib/5.18.2
  .

@p5pRT
Copy link
Author

p5pRT commented May 18, 2014

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

@p5pRT
Copy link
Author

p5pRT commented May 19, 2014

From @Tux

On Sun, 18 May 2014 15​:14​:26 -0700, "James E Keenan via RT"
<perlbug-followup@​perl.org> wrote​:

On Wed Mar 19 01​:36​:53 2014, nicholas wrote​:

Configure should use the ccflags and ldflags when probing for
libraries.

Right now it doesn't. So on this current Ubuntu x86_64 machine I can
build
blead no problem with ./Configure -Dusedevel -de.

But if I use

./Configure -Dusedevel -des -Accflags=-m32 -Aldflags=-m32
-Alddlflags=-shared\ -m32

I tried this command (Linux Ubuntu 13.10), but Configure bombed out
even more quickly for me than it did for you. Attaching Configure
output and perl -V output.

I have mentioned this before, and then there was no reply at all at
below snippet (real need for 32bit support on full 64bit (Linux)
machines) so I never dug into 32bit support.

On Wed, 28 Sep 2011 19​:30​:49 +0200, "H.Merijn Brand" <h.m.brand@​xs4all.nl> wrote​:

Not only will the result be reliable, but it will also open up the not
yet existing possibility to go back in time with things like
-Duse32bitall

Many compilers on modern systems will default to max avail, so 64bit is
the default and forcing to built 32bit is close to impossible. OTOH it
might be required to connect using 32bit libraries that are not
available in 64bit

FWIW, this was also in a reply to a question Nicholas asked

I think that the current state will not support a full 32bit build​: we
assume too many defaults for gcc

--
H.Merijn Brand http​://tux.nl Perl Monger http​://amsterdam.pm.org/
using perl5.00307 .. 5.19 porting perl5 on HP-UX, AIX, and openSUSE
http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org/
http​://qa.perl.org http​://www.goldmark.org/jeff/stupid-disclaimers/

@toddr
Copy link
Member

toddr commented Feb 4, 2020

@Tux Perhaps we should just abort with a more clear message on 64 bit systems when you try -m32 and call this not supported?

@jkeenan
Copy link
Contributor

jkeenan commented Apr 29, 2020

@Tux Perhaps we should just abort with a more clear message on 64 bit systems when you try -m32 and call this not supported?

That sounds like a reasonable approach to resolving this ticket as well as #13000. We should take this up early in the 5.33 cycle.

@khwilliamson
Copy link
Contributor

@Tux, This was proposed for early 5.33. Any status?

@Tux
Copy link
Contributor

Tux commented Nov 28, 2020

Sorry, no updates (yet). Severe lack of free time dedicatable to issues like these.

@xenu xenu removed the Severity Low label Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
toddr
  
Awaiting triage
Development

No branches or pull requests

6 participants