Commit Graph

7 Commits

Author SHA1 Message Date
Brad King 28490ecccb Merge topic 'aix-shared-flags'
bce7a2a AIX: Do not use -brtl to create shared libraries (#13997)
2013-03-12 13:47:04 -04:00
Brad King bce7a2a3a5 AIX: Do not use -brtl to create shared libraries (#13997)
The flag was added incorrectly by commit 9c3a6eb4 (Need -brtl when creating
shared libraries, 2003-05-16).  According to "man ld" the -G option implies
"-brtl -bnortllib ...", -brtl implies "-brtllib", and -brtllib should only be
used for executables, not shared libraries.  Therefore it is incorrect and
unnecessary to specify -brtl explicitly after -G.

Reported-by: Kevin Burge <kcburge@gmail.com>
2013-03-11 09:01:27 -04:00
Brad King baa33acbda AIX-GNU: Put implicit link directories in runtime libpath (#13909)
The GNU compiler front-ends on AIX invoke the linker with flags of the
form "-L/path/to/gnu/runtime/lib" to tell ld where to find the language
runtime libraries.  They depend on the default libpath behavior
documented in "man ld" to add the -L paths also to the runtime libpath
so the dynamic loader can find the language runtime libraries.  This
differs from platforms whose linkers have distinct -rpath flags that
non-system compilers can use to tell the dynamic loader where to find
their language runtime libraries.

Since commit 96fd5909 (Implement linking with paths to library files,
2008-01-22) CMake always passes "-Wl,-blibpath:" followed by any
project-defined RPATH plus "/usr/lib:/lib" in order to explicitly set
the runtime libpath and avoid getting all the project -L paths in the
runtime libpath.  The explicit libpath prevents the GNU compiler runtime
library -L paths from being placed in the libpath and then the dynamic
loader fails to find the language runtime libraries.

CMake already detects the implicit link directories for each language
since commit 07ea19ad (Implicit link info for C, CXX, and Fortran,
2009-07-23).  Add the implicit link directories to the explicit runtime
libpath for GNU compilers on AIX to fix this use case.
2013-02-14 10:16:36 -05:00
Brad King 767a7ad9da AIX-GNU: Link shared libs with -brtl,-bnoipath (#13352)
We already use these flags with the XL toolchain.  Use them for GNU too.
2012-07-09 17:18:41 -04:00
Brad King d30dcf18b9 Move RPATH flags to AIX per-compiler information files
Move RPATH flags out of Platform/AIX.cmake into platform-specific
compiler information files Platform/AIX-XL and Platform/AIX-GNU.
The flags need to be set for each compiler of each language.
2011-03-02 11:21:54 -05:00
Todd Gamblin 2cde67a781 Modules: Fix spelling 'To distributed' -> 'To distribute' 2010-08-09 08:48:31 -04:00
Brad King e28c16b482 Split GNU compiler information files
This moves GNU compiler flags into new-style modules

  Compiler/GNU-<lang>.cmake
  Platform/<os>-GNU-<lang>.cmake

We use language-independent helper modules

  Compiler/GNU.cmake
  Platform/<os>-GNU.cmake

to define macros consolidating the information.
2009-12-02 09:52:00 -05:00