[PATCH] Pass -g* through to linker

2012-08-21 Thread Andreas Schwab
This is needed for -flto so that debugging information isn't dropped.

* ltmain.m4sh (func_mode_link): Pass through -g*.
---
 build-aux/ltmain.m4sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 30f99f4..55f1a0b 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -5090,11 +5090,11 @@ func_mode_link ()
   # @fileGCC response files
   # -tp=*Portland pgcc target processor selection
   # --sysroot=*  for sysroot support
-  # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+  # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time 
optimization
   # -stdlib=*select c++ std lib with clang
   -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
   
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-  -O*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*)
+  -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*)
 func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
 func_append compile_command " $arg"
-- 
1.7.12


-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



Re: [PATCH] Update/simplify OpenBSD support

2012-08-21 Thread Brad Smith
On Tue, Aug 21, 2012 at 08:55:30PM -0500, Peter O'Gorman wrote:
> Hi Brad,
> 
> Thanks, I pushed this.
> 
> On 08/02/2012 01:46 AM, Brad Smith wrote:
> 
> >+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; the
> 
> I added the missing 'n' first though :)

Sorry about that. Looking at the commited diff there is still an
issue on line 2722.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




Re: [PATCH] Update/simplify OpenBSD support

2012-08-21 Thread Peter O'Gorman

On 08/21/2012 09:03 PM, Brad Smith wrote:


I added the missing 'n' first though :)


Sorry about that. Looking at the commited diff there is still an
issue on line 2722.



Thanks Brad,

I 'fixed' it, but didn't commit. :( Now the 'n' gets a commit all by itself.

I have no excuse, it's not even Monday.

Peter



Re: [PATCH] Pass -g* through to linker

2012-08-21 Thread Peter O'Gorman

Pushed. Thanks!

Peter

On 08/21/2012 09:46 AM, Andreas Schwab wrote:

This is needed for -flto so that debugging information isn't dropped.

* ltmain.m4sh (func_mode_link): Pass through -g*.
---
  build-aux/ltmain.m4sh | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 30f99f4..55f1a0b 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -5090,11 +5090,11 @@ func_mode_link ()
# @fileGCC response files
# -tp=*Portland pgcc target processor selection
# --sysroot=*  for sysroot support
-  # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+  # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time 
optimization
# -stdlib=*select c++ std lib with clang
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \

-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-  -O*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*)
+  -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*)
  func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
  func_append compile_command " $arg"






Re: [PATCH] Update/simplify OpenBSD support

2012-08-21 Thread Peter O'Gorman

Hi Brad,

Thanks, I pushed this.

On 08/02/2012 01:46 AM, Brad Smith wrote:


+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; the


I added the missing 'n' first though :)

Peter




Re: AIX PIC shared library support

2012-08-21 Thread Peter O'Gorman

Pushed. Thanks!

Peter

On 08/20/2012 12:12 PM, David Edelsohn wrote:

The GCC -fpic/-fPIC option has evolved to mean code generation for a
shared library and changes the optimization behavior of the compiler.
Code for AIX PowerPC always is PIC, but the optimization behavior is
affecting AIX.

libtool exports all global symbols on AIX while GCC binds_local_p()
determines that some function calls are local, causing GCC to emit the
local (non-external) form of function calls, which generates AIX
linker warnings.

The IBM XL compiler defaults to the equivalent of -fpic.  GCC could
try to match that, but it requires working around other GCC bootstrap
problems and continually chasing compatibility.  The other option is
to assume that developers using GCC to build shared libraries either
are using libtool or copying FOSS Makefiles designed for GNU/Linux or
expecting GNU/Linux compatibility.

The following patch starts to implement the latter by adding "-fPIC"
to the compiler command line options when building objects for a
shared library.  Because this places control in the hands of the user
with a command line option and matches GNU/Linux, this seems better
than playing with defaults and fighting GCC semantics for building
shared libraries.

Comments?

Thanks, David

 * m4/libtool.m4 (_LT_COMPILER_PIC): Add -fPIC to GCC and GXX for AIX.

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index a8ecbc3..d0a5577 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -3874,6 +3874,7 @@ m4_if([$1], [CXX], [
 # AIX 5 now supports IA64 processor
 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
+  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;

  amigaos*)
@@ -4191,6 +4192,7 @@ m4_if([$1], [CXX], [
 # AIX 5 now supports IA64 processor
 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
+  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;

  amigaos*)






[PATCH] Add Bitrig support

2012-08-21 Thread Brad Smith
The following diff adds support for Bitrig, which is a
fork of OpenBSD.


diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 1d71f0e..28398fd 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -4849,7 +4849,7 @@ func_mode_link ()
# These systems don't actually have a C library (as such)
test X-lc = "X$arg" && continue
;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
# Do not include libc due to us having libc/libc_r.
test X-lc = "X$arg" && continue
;;
@@ -6879,7 +6879,7 @@ func_mode_link ()
  *-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
# Do not include libc due to us having libc/libc_r.
;;
  *-*-sco3.2v5* | *-*-sco5v6*)
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index bd0bb9e..1b5012f 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1474,7 +1474,7 @@ old_postuninstall_cmds=
 
 if test -n "$RANLIB"; then
   case $host_os in
-  openbsd*)
+  openbsd* | bitrig*)
 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
 ;;
   *)
@@ -1642,7 +1642,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
 lt_cv_sys_max_cmd_len=8192;
 ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly* | bitrig*)
 # This has been around since 386BSD, at least.  Likely further.
 if test -x /sbin/sysctl; then
   lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -2715,7 +2715,7 @@ newsos6)
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   version_type=sunos
   sys_lib_dlsearch_path_spec=/usr/lib
   need_lib_prefix=no
@@ -3286,7 +3286,7 @@ newos6*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
 lt_cv_deplibs_check_method='match_pattern 
/lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
   else
@@ -4632,7 +4632,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
 # we just hope/assume this is gcc and not c89 (= MSVC++)
 with_gnu_ld=yes
 ;;
-  openbsd*)
+  openbsd* | bitrig*)
 with_gnu_ld=no
 ;;
   esac
@@ -5361,7 +5361,7 @@ _LT_EOF
 *nto* | *qnx*)
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   if test -f /usr/libexec/ld.so; then
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -6553,7 +6553,7 @@ if test yes != "$_lt_caught_CXX_error"; then
 _LT_TAGVAR(ld_shlibs, $1)=yes
;;
 
-  openbsd*)
+  openbsd* | bitrig*)
if test -f /usr/libexec/ld.so; then
  _LT_TAGVAR(hardcode_direct, $1)=yes
  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
diff --git a/m4/ltdl.m4 b/m4/ltdl.m4
index 6cb5727..9b2a535 100644
--- a/m4/ltdl.m4
+++ b/m4/ltdl.m4
@@ -496,7 +496,7 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
   netbsd*)
 lt_cv_sys_dlopen_deplibs=yes
 ;;
-  openbsd*)
+  openbsd* | bitrig*)
 lt_cv_sys_dlopen_deplibs=yes
 ;;
   osf[[1234]]*)
diff --git a/tests/deplibs-ident.at b/tests/deplibs-ident.at
index 5758311..c47586a 100644
--- a/tests/deplibs-ident.at
+++ b/tests/deplibs-ident.at
@@ -67,7 +67,7 @@ int main() { return a1() + a2() + a3() + c(); }
   [0],[stdout],[ignore])
   AT_CHECK([$EGREP 'cee.*cee' stdout], 1, [ignore], [ignore])
   AT_XFAIL_IF([case $host in
- *-*-aix*|hppa*-*-hpux*|*-*-interix*|*-*-openbsd*) false;;
+ *-*-aix*|hppa*-*-hpux*|*-*-interix*|*-*-openbsd*|*-*-bitrig*) 
false;;
  *):;;
esac])
   dnl This is currently broken in libtool

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.