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

lddlflags (and ccdlflags) overridden on GNU/kFreeBSD #12498

Closed
p5pRT opened this issue Oct 17, 2012 · 9 comments
Closed

lddlflags (and ccdlflags) overridden on GNU/kFreeBSD #12498

p5pRT opened this issue Oct 17, 2012 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 17, 2012

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

Searchable as RT115324$

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2012

From @ntyni

This is a bug report for perl from Niko Tyni <ntyni@​debian.org>,
generated with the help of perlbug 1.39 running under perl 5.17.5.


hints/gnukfreebsd.sh currently overrides any lddflags (or ccdlflags)
values given as Configure arguments.

Further, digging into the history, it looks like the
comment about Configure setting these "where $osname = linux"
was outdated even when it was applied in commit
46c947e (Perforce change 24017)
as the earlier commit
fb2e1bc (Perforce change 23909)
added gnu* matches to the relevant Configure parts.

The attached proposed patch removes the divergences from Linux hints
as unnecessary.

This is also <http​://bugs.debian.org/689713>.



Flags​:
  category=core
  severity=low


Site configuration information for perl 5.17.5​:

Configured by niko at Wed Oct 17 15​:17​:11 EEST 2012.

Summary of my perl5 (revision 5 version 17 subversion 5) configuration​:
  Local Commit​: d7993ad77af99331542d3e35f0e880d9e31c7bbb
  Ancestor​: ba71441
  Platform​:
  osname=gnukfreebsd, osvers=9.0-2-amd64, archname=x86_64-gnukfreebsd-thread-multi
  uname='gnukfreebsd karolina 9.0-2-amd64 #0 sat sep 22 19​:00​:52 utc 2012 x86_64 amd64 qemu virtual cpu version 1.1.2 gnukfreebsd '
  config_args='-des -Dusedevel -Dusethreads'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=define, usemultiplicity=define
  useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  use64bitint=define, use64bitall=define, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2',
  cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.7.2', 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-kfreebsd-gnu /lib/../lib /usr/lib/x86_64-kfreebsd-gnu /usr/lib/../lib /lib /usr/lib
  libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
  libc=, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.13'
  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'

Locally applied patches​:
 


@​INC for perl 5.17.5​:
  lib
  /usr/local/lib/perl5/site_perl/5.17.5/x86_64-gnukfreebsd-thread-multi
  /usr/local/lib/perl5/site_perl/5.17.5
  /usr/local/lib/perl5/5.17.5/x86_64-gnukfreebsd-thread-multi
  /usr/local/lib/perl5/5.17.5
  .


Environment for perl 5.17.5​:
  HOME=/home/niko
  LANG=en_US.UTF-8
  LANGUAGE=en_US​:en
  LC_CTYPE=fi_FI.UTF-8
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/usr/local/bin​:/usr/bin​:/bin​:/usr/local/games​:/usr/games
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2012

From @ntyni

0001-Don-t-overwrite-Config-lddlflags-or-ccdlflags-on-GNU.patch
From d7993ad77af99331542d3e35f0e880d9e31c7bbb Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Tue, 16 Oct 2012 23:51:02 +0300
Subject: [PATCH] Don't overwrite $Config{lddlflags} or ccdlflags on
 GNU/kFreeBSD

Blindly overwriting lddflags or ccdlflags overrides any additional
values given as Configure arguments.

Further, digging into the history, it looks like the
comment about Configure setting these "where $osname = linux"
was outdated even when it was applied in commit
 46c947e8b9def6de34ac831834a3c290ab266515 (Perforce change 24017)
as the earlier commit
 fb2e1bc0638d5a5d7ac552a79a71a996a5d604cc (Perforce change 23909)
added gnu* matches to the relevant Configure parts.

Therefore removing the divergences from Linux hints as unnecessary.
---
 hints/gnukfreebsd.sh |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/hints/gnukfreebsd.sh b/hints/gnukfreebsd.sh
index 1225f69..435afe7 100644
--- a/hints/gnukfreebsd.sh
+++ b/hints/gnukfreebsd.sh
@@ -5,6 +5,3 @@
 
 . ./hints/linux.sh
 
-# Configure sets these where $osname = linux
-ccdlflags='-Wl,-E'
-lddlflags='-shared'
-- 
1.7.10.4

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2012

From @Leont

On Wed, Oct 17, 2012 at 4​:33 PM, Niko Tyni <perlbug-followup@​perl.org> wrote​:

hints/gnukfreebsd.sh currently overrides any lddflags (or ccdlflags)
values given as Configure arguments.

Further, digging into the history, it looks like the
comment about Configure setting these "where $osname = linux"
was outdated even when it was applied in commit
46c947e (Perforce change 24017)
as the earlier commit
fb2e1bc (Perforce change 23909)
added gnu* matches to the relevant Configure parts.

The attached proposed patch removes the divergences from Linux hints
as unnecessary.

This is also <http​://bugs.debian.org/689713>.

The patch looks sensible to me.

That said, the fact that you need to override lddlflags suggests
things are broken. I guess you override it to to mix in that
"-Wl,-z,relro" from ldflags. Configure mixes part of ldflags into
lddlflags (-L*|-R*|-Wl,-R* and -fstack-protector), but the rationale
isn't well documented. Perhaps Configure should include -Wl* or even
all of ldflags, I have no idea if the current behavior is just
historical raisins or actually important.

I wish lddlflags was as simple as setting it to '-shared' and ldflags
was entirely unrelated, that would have made a lot more sense. The
whole thing is just convoluted if you ask me. I'd welcome some
'lddlargs' config variable for that purpose.

Leon

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2012

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

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2012

From @Tux

On Wed, 17 Oct 2012 18​:32​:34 +0200, Leon Timmermans <fawaka@​gmail.com>
wrote​:

On Wed, Oct 17, 2012 at 4​:33 PM, Niko Tyni <perlbug-followup@​perl.org> wrote​:

hints/gnukfreebsd.sh currently overrides any lddflags (or ccdlflags)
values given as Configure arguments.

Further, digging into the history, it looks like the
comment about Configure setting these "where $osname = linux"
was outdated even when it was applied in commit
46c947e (Perforce change 24017)
as the earlier commit
fb2e1bc (Perforce change 23909)
added gnu* matches to the relevant Configure parts.

The attached proposed patch removes the divergences from Linux hints
as unnecessary.

This is also <http​://bugs.debian.org/689713>.

The patch looks sensible to me.

That said, the fact that you need to override lddlflags suggests
things are broken. I guess you override it to to mix in that
"-Wl,-z,relro" from ldflags. Configure mixes part of ldflags into
lddlflags (-L*|-R*|-Wl,-R* and -fstack-protector), but the rationale
isn't well documented. Perhaps Configure should include -Wl* or even
all of ldflags, I have no idea if the current behavior is just
historical raisins or actually important.

/me enters the swamp ...

It is a squishy gray line of what *can* and what *cannot* we
included/promoted.

e.g. there are some native compilers that allow $CC to be native and
$LD to be the GNU loader. There are also other architectures NOT
supported by GNU-ld (from binutils) so that you /can/ use gcc, but it
needs to be linked with the native loader. That loader might or might
not accept -Wl,… flags. Some are smart, and "see" that it was meant for
it anyway, others barf and exit.

I wish lddlflags was as simple as setting it to '-shared' and ldflags

$ ld -shared
ld​: Unrecognized argument​: -shared

We're not all living in a GNU world

was entirely unrelated, that would have made a lot more sense. The
whole thing is just convoluted if you ask me. I'd welcome some
'lddlargs' config variable for that purpose.

Leon

--
H.Merijn Brand http​://tux.nl Perl Monger http​://amsterdam.pm.org/
using perl5.00307 .. 5.17 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/

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2012

From @doughera88

On Wed, 17 Oct 2012, Niko Tyni wrote​:

# New Ticket Created by Niko Tyni
# Please include the string​: [perl #115324]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=115324 >

This is a bug report for perl from Niko Tyni <ntyni@​debian.org>,
generated with the help of perlbug 1.39 running under perl 5.17.5.

-----------------------------------------------------------------
hints/gnukfreebsd.sh currently overrides any lddflags (or ccdlflags)
values given as Configure arguments.

Further, digging into the history, it looks like the
comment about Configure setting these "where $osname = linux"
was outdated even when it was applied in commit
46c947e (Perforce change 24017)
as the earlier commit
fb2e1bc (Perforce change 23909)
added gnu* matches to the relevant Configure parts.

The attached proposed patch removes the divergences from Linux hints
as unnecessary.

This is also <http​://bugs.debian.org/689713>.
-----------------------------------------------------------------

Yes, this looks sensible. I'll take care of it. I'll also remove the same
lines in the gnuknetbsd hints. This came in as part of a jumbo set of
patches from Debian, and it wasn't realized at the time that they had been
rendered unnecessary by other Configure changes.

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2012

From @doughera88

On Wed, 17 Oct 2012, Andy Dougherty wrote​:

On Wed, 17 Oct 2012, Niko Tyni wrote​:

# New Ticket Created by Niko Tyni
# Please include the string​: [perl #115324]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=115324 >

This is a bug report for perl from Niko Tyni <ntyni@​debian.org>,
generated with the help of perlbug 1.39 running under perl 5.17.5.

-----------------------------------------------------------------
hints/gnukfreebsd.sh currently overrides any lddflags (or ccdlflags)
values given as Configure arguments.

Further, digging into the history, it looks like the
comment about Configure setting these "where $osname = linux"
was outdated even when it was applied in commit
46c947e (Perforce change 24017)
as the earlier commit
fb2e1bc (Perforce change 23909)
added gnu* matches to the relevant Configure parts.

The attached proposed patch removes the divergences from Linux hints
as unnecessary.

This is also <http​://bugs.debian.org/689713>.
-----------------------------------------------------------------

Yes, this looks sensible. I'll take care of it. I'll also remove the same
lines in the gnuknetbsd hints. This came in as part of a jumbo set of
patches from Debian, and it wasn't realized at the time that they had been
rendered unnecessary by other Configure changes.

Thanks, applied as commit 7dc6565
This also changed hints/gnuknetbsd.sh to match as well.

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2012

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

@p5pRT p5pRT closed this as completed Oct 17, 2012
@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2012

From @Leont

On Wed, Oct 17, 2012 at 7​:17 PM, H.Merijn Brand <h.m.brand@​xs4all.nl> wrote​:

It is a squishy gray line of what *can* and what *cannot* we
included/promoted.

e.g. there are some native compilers that allow $CC to be native and
$LD to be the GNU loader. There are also other architectures NOT
supported by GNU-ld (from binutils) so that you /can/ use gcc, but it
needs to be linked with the native loader. That loader might or might
not accept -Wl,… flags. Some are smart, and "see" that it was meant for
it anyway, others barf and exit.

Yeah, I realize this is messy, but I do think we can make it slightly better.

I wish lddlflags was as simple as setting it to '-shared' and ldflags

$ ld -shared
ld​: Unrecognized argument​: -shared

We're not all living in a GNU world

I know, I meant it in the sense that I wish it would have whatever
value is needed to make something a shared object, and nothing more,
the same way cccdlflags is whatever is needed to make it position
independent.

Leon

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

No branches or pull requests

1 participant