CMake issueshttps://gitlab.kitware.com/cmake/cmake/-/issues2023-04-26T12:55:58-04:00https://gitlab.kitware.com/cmake/cmake/-/issues/24844AIX not detecting compiler ?2023-04-26T12:55:58-04:00tmx1835AIX not detecting compiler ?I am trying to port our cmake project from Linux to AIX but have hit a bit of a problem, so i pared it back to a simple hello world my app. Not sure where to go at this point. We really want to move away from our old legacy shell scripts...I am trying to port our cmake project from Linux to AIX but have hit a bit of a problem, so i pared it back to a simple hello world my app. Not sure where to go at this point. We really want to move away from our old legacy shell scripts and makefiles but this is a stopper for me.
I am going to get the XLC updated to the latest 16.10 patch set, but that will take a few days i imagine, not sure if that will help though.
**CMakeLists.txt**
```cmake
cmake_minimum_required(VERSION 3.10)
project(myapp)
add_executable(myapp myapp.cpp)
```
**myapp.cpp**
```c++
#include <stdio.h>
int main(int argc char**argv) {
return printf("Hello MyApp\n");
}
```
We've got XLC 16 loaded
```console
-bash-5.1$ xlC -qversion
IBM XL C/C++ for AIX, V16.1.0 (5725-C72, 5765-J12)
Version: 16.01.0000.0007
-bash-5.1$ cc -qversion
IBM XL C/C++ for AIX, V16.1.0 (5725-C72, 5765-J12)
Version: 16.01.0000.0007
-bash-5.1$
```
when i run a cmake . it fails to build the Makefiles with the following output
```
-- The C compiler identification is unknown
-- The CXX compiler identification is XL 16.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /opt/IBM/xlC/16.1.0/bin/cc
-- Check for working C compiler: /opt/IBM/xlC/16.1.0/bin/cc - broken
CMake Error at /opt/freeware/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
The C compiler
"/opt/IBM/xlC/16.1.0/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /data/js/cmaketest/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/local/bin/gmake -f Makefile cmTC_b4d42/fast && /usr/local/bin/gmake -f CMakeFiles/cmTC_b4d42.dir/build.make CMakeFiles/cmTC_b4d42.dir/build
gmake[1]: Entering directory '/data/js/cmaketest/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_b4d42.dir/testCCompiler.c.o
/opt/IBM/xlC/16.1.0/bin/cc -o CMakeFiles/cmTC_b4d42.dir/testCCompiler.c.o -c /data/js/cmaketest/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_b4d42
/opt/freeware/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b4d42.dir/link.txt --verbose=1
/opt/IBM/xlC/16.1.0/bin/cc CMakeFiles/cmTC_b4d42.dir/testCCompiler.c.o -o cmTC_b4d42 /usr/lib /lib
ld: 0711-168 SEVERE ERROR: Input file: /usr/lib
Input files must be regular files.
CMakeFiles/cmTC_b4d42.dir/build.make:98: recipe for target 'cmTC_b4d42' failed
gmake[1]: *** [cmTC_b4d42] Error 12
gmake[1]: Leaving directory '/data/js/cmaketest/CMakeFiles/CMakeTmp'
Makefile:127: recipe for target 'cmTC_b4d42/fast' failed
gmake: *** [cmTC_b4d42/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:4 (project)
-- Configuring incomplete, errors occurred!
See also "/data/js/cmaketest/CMakeFiles/CMakeOutput.log".
See also "/data/js/cmaketest/CMakeFiles/CMakeError.log".
-bash-5.1$
```
**Cmake version 3.22.0**
```console
-bash-5.1$ cmake --version
cmake version 3.22.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).
-bash-5.1$
```https://gitlab.kitware.com/cmake/cmake/-/issues/24229AIX: ccmake fails to compile due to macros from /usr/include/term.h2022-12-08T07:58:13-05:00Iwan ZaremboAIX: ccmake fails to compile due to macros from /usr/include/term.hI am trying to build cmake 3.25.1 on AIX using XLClang 16.1.0.11 with the flags:
```
CFLAGS: -D_AIX=1 -DSYSV=1 -D_ALL_SOURCE=1 -DFUNCPROTO=15 -qxlcompatmacros -qstrict=all
CXXFLAGS: -D_AIX=1 -DSYSV=1 -D_ALL_SOURCE=1 -DFUNCPROTO=15 -std=...I am trying to build cmake 3.25.1 on AIX using XLClang 16.1.0.11 with the flags:
```
CFLAGS: -D_AIX=1 -DSYSV=1 -D_ALL_SOURCE=1 -DFUNCPROTO=15 -qxlcompatmacros -qstrict=all
CXXFLAGS: -D_AIX=1 -DSYSV=1 -D_ALL_SOURCE=1 -DFUNCPROTO=15 -std=c++11
CPPFLAGS: -D_AIX=1 -DSYSV=1 -D_ALL_SOURCE=1 -DFUNCPROTO=15
```
The build itself is working up to 91%, but then I get the error below:
```
[ 91%] Building CXX object Source/CursesDialog/CMakeFiles/ccmake.dir/ccmake.cxx.o
In file included from /data/Source/CursesDialog/ccmake.cxx:24:
In file included from /data/Source/cmake.h:36:
/data/Source/cmCMakePresetsGraph.h:479:28: error: expected ')'
PrintPrecedingNewline* newline = nullptr) const;
^
/usr/include/term.h:248:20: note: expanded from macro 'newline'
#define newline CUR _Vr2_Bstrs._s104
^
/usr/include/term.h:1325:24: note: expanded from macro 'CUR'
# define CUR cur_term->
^
```
The build with the flags works for release 3.23.2.
Was someone able to build cmake 3.25.1 on AIX ?3.25.2Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/22098libuv: UDP multicast fails to compile on AIX 5.32021-04-22T10:21:03-04:00Zsigmond Lőrinczylibuv: UDP multicast fails to compile on AIX 5.3Hi, I admit I feel like I've arrived into an alternate universe.
I tried to compile cmake-3.18.1 in AIX5.3 and got error message about missing `ip_mreq_source` and `IP_ADD_SOURCE_MEMBERSHIP` when compiling `Utilities/cmlibuv/src/unix/ud...Hi, I admit I feel like I've arrived into an alternate universe.
I tried to compile cmake-3.18.1 in AIX5.3 and got error message about missing `ip_mreq_source` and `IP_ADD_SOURCE_MEMBERSHIP` when compiling `Utilities/cmlibuv/src/unix/udp.c`
Now my question is simple: if `cmake` is a build system, why on earth is UDP-multicast part of it?https://gitlab.kitware.com/cmake/cmake/-/issues/21112AIX: Missing *.so shared library file2020-08-25T11:26:03-04:00Rasit SimsekAIX: Missing *.so shared library fileSince CMake V3.14 shared library is build in an archive format with ".a" suffix. But we need a shared library file with ".so" suffix. What I have found out in AIX-GNU.cmake the .so file will be deleted and there is no possibility to acce...Since CMake V3.14 shared library is build in an archive format with ".a" suffix. But we need a shared library file with ".so" suffix. What I have found out in AIX-GNU.cmake the .so file will be deleted and there is no possibility to access on it to copy to another place. The only solution what I have found is adding a "cp <OBJECT_DIR>/lib<TARGET_NAME>.so <TARGET_BASE>.so" line to keep the .so file. Is there a another possibility the create shared library with ".so" suffix?
```
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# This module is shared by multiple languages; use include blocker.
if(__AIX_COMPILER_GNU)
return()
endif()
set(__AIX_COMPILER_GNU 1)
macro(__aix_compiler_gnu lang)
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-bnoipath -Wl,-blibpath:")
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
set(CMAKE_SHARED_MODULE_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_${lang}_FLAGS})
set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS})
set(CMAKE_${lang}_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH 1)
if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 7 OR CMAKE_SYSTEM_VERSION VERSION_LESS 7.1)
unset(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY)
endif()
# By default, module are .so and shared libraries .a in AIX.
# As this comportment can be overwritten or misrespected we provides both .a and stripped .so.
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
"<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <OBJECT_DIR>/lib<TARGET_NAME>.so <OBJECTS> <LINK_LIBRARIES>"
"<CMAKE_AR> -c -q <TARGET> <OBJECT_DIR>/lib<TARGET_NAME>.so"
"cp <OBJECT_DIR>/lib<TARGET_NAME>.so <TARGET_BASE>.so" # <-- Patched line
"rm <OBJECT_DIR>/lib<TARGET_NAME>.so"
)
set(CMAKE_${lang}_CREATE_SHARED_MODULE
"<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_MODULE_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
"strip -e -X32_64 <TARGET>"
)
endmacro()
```https://gitlab.kitware.com/cmake/cmake/-/issues/20612AIX: install(TARGETS) not working2020-04-22T08:13:23-04:00Sarang JoshiAIX: install(TARGETS) not workingCMake code:
```cmake
include(GNUInstallDirs)
# Collect all binaries under bin/ folder
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
...
set(EXE exeName)
add_executable(${EXE} main.cpp)
install(TARGETS ...CMake code:
```cmake
include(GNUInstallDirs)
# Collect all binaries under bin/ folder
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
...
set(EXE exeName)
add_executable(${EXE} main.cpp)
install(TARGETS ${EXE} RUNTIME)
```
`cmake --install .` output:
```console
CMake Error at apps/.../cmake_install.cmake:46 (file):
file INSTALL cannot find
"/build/aix6/.../CMakeFiles/CMakeRelink.dir/exeName":
No such file or directory.
Call Stack (most recent call first):
apps/cmake_install.cmake:52 (include)
cmake_install.cmake:42 (include)
```https://gitlab.kitware.com/cmake/cmake/-/issues/20521XLC C++ should not declare full C++11 and C++14 support2021-08-23T11:09:42-04:00Viacheslav ChernyshevXLC C++ should not declare full C++11 and C++14 supportOperating system: AIX 7.1.
Compiler version:
```
bash-4.3$ ./xlC -qversion
IBM XL C/C++ for AIX, V16.1.0 (5725-C72, 5765-J12)
Version: 16.01.0000.0004
```
Hey guys,
We have recently started an attempt to upgrade the AIX compiler use...Operating system: AIX 7.1.
Compiler version:
```
bash-4.3$ ./xlC -qversion
IBM XL C/C++ for AIX, V16.1.0 (5725-C72, 5765-J12)
Version: 16.01.0000.0004
```
Hey guys,
We have recently started an attempt to upgrade the AIX compiler used at our company to version 16.1.0 and it has revealed that CMake is too eager to declare that this compiler has full support for the C++11 and C++14 features. To give a tiny example, this C++ file:
```cpp
struct Dummy
{
void something() noexcept {}
};
int main(int, char**)
{
return 0;
}
```
Does not compile when I request `cxx_std_11` via `target_compile_features` (CMake passes `-qlanglvl=extended0x`):
```
"test.cpp", line 3.22: 1540-0063 (S) The text "noexcept" is unexpected.
```
It's even worse when I request `cxx_std_14` though because then CMake passes `-qlanglvl=extended1y` which is, apparently, not a valid compiler flag:
```
1540-5200 (W) The option "langlvl=extended1y" is not supported.
"test.cpp", line 3.22: 1540-0063 (S) The text "noexcept" is unexpected.
```
As far as I'm aware, no version of XLC has full support for C++11 and C++14, so `CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT` and `CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT` cannot be set to `ON`. Probably it should follow the same individual feature detection model as `SunPro-CXX-FeatureTests.cmake`?https://gitlab.kitware.com/cmake/cmake/-/issues/20520AIX: ExportImportList not executable in CMake installation2020-05-11T12:09:13-04:00av74AIX: ExportImportList not executable in CMake installationWhen I try to build a project with cmake 3.17.0 on IBM AIX OS the link process give me "Error running link command: Permission denied".
`
cmake -E cmake_link_script CMakeFiles/cmsysTestDynload.dir/link.txt –verbose=1
"/opt/cmake-3.17.0...When I try to build a project with cmake 3.17.0 on IBM AIX OS the link process give me "Error running link command: Permission denied".
`
cmake -E cmake_link_script CMakeFiles/cmsysTestDynload.dir/link.txt –verbose=1
"/opt/cmake-3.17.0/share/cmake-3.17/Modules/Platform/AIX/ExportImportList"
-o CmakeFiles/cmsysTestDynload.dir/objects.exp
CmakeFiles/cmsysTestDynload.dir/testDynload.c.o
Error running link command: Permission denied
`
The error is caused by "ExportImportList" shell script that on my system is not executable "-rw-r--r--".
After manually adding the execution permission with "chmod +x" all go fine.
cmake 3.17.0 version was configured and builded by me from sources with "GNU Make 4.2.1" "gcc 6.3.0" on OS AIX 7.2 TL3 and installed on custom path "/opt/cmake-3.17.0" with "make install" command.
Is this problem caused by some my installation error or a bug in "make install" command ?3.16.6Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/20290AIX: Allow user to disable automatic export symbols2022-03-28T10:47:50-04:00Devin NakamuraAIX: Allow user to disable automatic export symbolsCurrently we are providing our own list of exported symbols to the aix linker, and preventing CMake from auto generating the list by setting `-DCMAKE_CreateExportList=`on the command line. However, this technique stops working with 3.1...Currently we are providing our own list of exported symbols to the aix linker, and preventing CMake from auto generating the list by setting `-DCMAKE_CreateExportList=`on the command line. However, this technique stops working with 3.16. Can you add a mechanism for disabling the new 'ExportImportList' script for allowing projects which wish to manage their own exports?3.17.0Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/19519AIX: Export static library symbols from executables with ENABLE_EXPORTS2020-01-29T14:19:09-05:00Brad KingAIX: Export static library symbols from executables with ENABLE_EXPORTSSince !3561 CMake creates an import library for an executable with the `ENABLE_EXPORTS` property set. The purpose is to export symbols from the executable such that they can be linked by loadable modules. We do this on Windows too.
Ho...Since !3561 CMake creates an import library for an executable with the `ENABLE_EXPORTS` property set. The purpose is to export symbols from the executable such that they can be linked by loadable modules. We do this on Windows too.
However, we are currently only exporting symbols from the object files in the executable target itself. Symbols that are brought into the executable from linked static libraries are not exported on AIX (but they are on Windows if they have `__declspec(dllexport)` markup).Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/19494AIX: Use archives for shared libraries2022-02-17T09:23:02-05:00Brad KingAIX: Use archives for shared librariesOn UNIX platforms a "shared object" is a binary object that can be linked by another binary and loaded at runtime. On most UNIX platforms shared objects are stored as standalone files with a `.so` extension and called "shared libraries"...On UNIX platforms a "shared object" is a binary object that can be linked by another binary and loaded at runtime. On most UNIX platforms shared objects are stored as standalone files with a `.so` extension and called "shared libraries". Dependent binaries record a "soname" for each shared object on which they depend, e.g. `libfoo.so` (possibly with a version suffix but that is not relevant here). At runtime the dynamic loader searches for a file on disk with the corresponding soname.
On AIX, binaries record two fields for each shared object dependency: a "base" file name and an optional "member" name. One may use `dump -H` to see the recorded dependencies of a real binary. There are two cases:
* The "base" file name may refer directly to a shared object file name (e.g. `libfoo.so`), in which case the "member" field is unused/empty. This is much like the simple "soname" used on other UNIX platforms. At runtime the dynamic loader searches for the shared object file on disk.
* The "base" file name may refer to a library archive file (e.g. `libfoo.a`) that contains a shared object, in which case the "member" field is the name of the shared object within the archive (e.g. `libfoo.so`, `foo.so`, or even just `foo.o` so long as `dump -ov` shows a `SHROBJ` flag). At runtime the dynamic loader searches for the base file name of each dependency and then finds the required shared object member in the archive.
AIX documentation distinguishes between a "shared object" and a "shared library", with the latter being a library archive (`.a`) file containing a shared object. On AIX a shared library archive file may contain multiple shared objects, e.g. for different groups of symbols or even for distinct architectures.
CMake currently implements shared libraries on AIX by using shared object (`.so`) files directly on disk due to consistency with other platforms. We should consider instead implementing them as shared library (`.a`) archive files.https://gitlab.kitware.com/cmake/cmake/-/issues/19196Test LoadedCommandOneConfig fails in 64bit on AIX : prctl.h2019-04-30T12:54:01-04:00Tony ReixTest LoadedCommandOneConfig fails in 64bit on AIX : prctl.hHi,
On AIX, the test LoadedCommandOneConfig is OK in 32bit, but it fails in 64bit.
That seems to deal with the prctl.h file , which does not exist on AIX.
At build, traces show:
Looking for sys/prctl.h
Configuring
...Hi,
On AIX, the test LoadedCommandOneConfig is OK in 32bit, but it fails in 64bit.
That seems to deal with the prctl.h file , which does not exist on AIX.
At build, traces show:
Looking for sys/prctl.h
Configuring
Looking for sys/prctl.h - not found
...
Logs :
cat Tests/LoadCommandOneConfig/CMakeFiles/CMakeError.log :
/usr/bin/gcc -maix64 -o CMakeFiles/cmTC_2d515.dir/CheckIncludeFile.c.o
-c Tests/LoadCommandOneConfig/CMakeFiles/CMakeTmp/CheckIncludeFile.c
Tests/LoadCommandOneConfig/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: sys/prctl.h: No such file or directory
Looking at details of the test, we see:
Tests/LoadCommandOneConfig/LoadedCommand.h :
/* #undef HAVE_SYS_PRCTL_H */
Tests/LoadCommandOneConfig/CMakeLists.txt :
include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
CHECK_INCLUDE_FILE("sys/prctl.h" HAVE_SYS_PRCTL_H)
..../Modules/CMakeBackwardCompatibilityC.cmake :
include (CheckIncludeFiles)
CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SYS_PRCTL_H
..../Modules/CMakeBackwardCompatibilityCXX.cmake :
Nothing dealing with prctl.h nor CMAKE_HAVE_SYS_PRCTL_H
Does this test work in 64bit on other systems where prct.h does not exist ?
Since the issue appears in 64bit and not in 3ébit, this may be due to the CFLAGS/CXXFLAGS variables, which must be set (-maix64 ou -q64) on AIX, that are not correctly handled in the test.
Regards,
Tonyhttps://gitlab.kitware.com/cmake/cmake/-/issues/19195Test FindPackageModeMakefileTest fails in 64bit on systems where CXXFLAG is ...2019-04-30T12:53:35-04:00Tony ReixTest FindPackageModeMakefileTest fails in 64bit on systems where CXXFLAG is required, like AIXHi,
On AIX, when testing with GCC/XLC in 32bit, this test is OK.
However, when testing in 64bit, one has to add either CXXFLAGs=-maix64 (GCC) or CXXFLAGS=-q64 (XLC), but the code of the test does not manage CXXFLAGS (nor CFLAGS), a...Hi,
On AIX, when testing with GCC/XLC in 32bit, this test is OK.
However, when testing in 64bit, one has to add either CXXFLAGs=-maix64 (GCC) or CXXFLAGS=-q64 (XLC), but the code of the test does not manage CXXFLAGS (nor CFLAGS), and the test fails complaining about wrong (32bit) assembler generated code (because : "export OBJECT_MODE=64" was used for AIX tools like "ld") :
469: "/usr/bin/g++" -D_LARGE_FILES -DSYSV -D_AIX -D_ALL_SOURCE -DFUNCPROTO=15 -D_AIX71 -D_AIX72 -mcmodel=large -pthread \
-I$BUILD/cmake-3.14.2/Tests/FindPackageModeMakefileTest -I"/some/path/with a space/include" -c main.cpp
469: Assembler:
469: /tmp//ccPwH5oE.s: line 8: Only .llong should be used for relocatable expressions.
469: /tmp//ccPwH5oE.s: line 61: Only .llong should be used for relocatable expressions.
This seems to be due to the ConfMakefile which does:
CMAKE_CXX_FLAGS = -D_LARGE_FILES -DSYSV -D_AIX -D_ALL_SOURCE -DFUNCPROTO=15 -D_AIX71 -D_AIX72 -mcmodel=large -pthread
CMAKE_FOO = $(CMAKE) --find-package -DCMAKE_MODULE_PATH=$(CMAKE_CURRENT_BINARY_DIR) -DNAME=Foo -DLANGUAGE=CXX -DCOMPILER_ID=$(CMAKE_CXX_COMPILER_ID)
and which does not handle CXXFLAGS variable that was correctly exported in the test script, like:
export CFLAGS=-maix64
export CXXFLAGS=-maix64
./bin/ctest -VV -R FindPackageModeMakefileTest "--build-options" "-DCMAKE_C_FLAGS=-maix64" "-DCMAKE_CXX_FLAGS=-maix64"
Regards,
Tonyhttps://gitlab.kitware.com/cmake/cmake/-/issues/19163AIX export symbols incorrect2023-05-31T13:27:33-04:00David EdelsohnAIX export symbols incorrectCMake rules for AIX do not export the correct symbols and do not use the correct mechanism to export symbols.
CMake currently invokes the AIX linker with -bexpall to export "all" symbols. This is incorrect because it does not export C+...CMake rules for AIX do not export the correct symbols and do not use the correct mechanism to export symbols.
CMake currently invokes the AIX linker with -bexpall to export "all" symbols. This is incorrect because it does not export C++ mangled symbols as defined by the Itanium ABI. (-bexpfull would export more symbols but causes even more problems and NEVER SHOULD BE USED.) Exporting too many symbols causes problems because a shared library may re-export symbols from another library causing confused dependencies, duplicate symbols and other problems. CMake should explicitly create an export list in the same manner as GNU Libtool.
CMake also creates shared libraries with -G/-brtl. This normally is not necessary and harmful. This often will overflow the TOC. It forces all global calls through function descriptors (PLTs) so that they can be overridden, but most applications are not invoked in a manner that requires symbolic overriding of symbols. The excessive use of function descriptors also greatly harms performance on AIX.
This behavior seems to have been introduced in CMake in 2013. The Mantis bug reports are unclear about the exact symptoms, but the solution needs to be redesigned in a manner more consistent with AIX semantics.3.16.0Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/18596CMake Server segmentation fault on AIX architecture2023-12-11T12:11:26-05:00Liang TiCMake Server segmentation fault on AIX architectureRecently I have an issue while using cmake server on AIX platform. This issue happens when cmake exits.
I notice one thing that is macro `HAVE_SYS_AHAFS_EVPRODS_H` seems not define in CMake repo but is required by libuv:
[libuv](https:/...Recently I have an issue while using cmake server on AIX platform. This issue happens when cmake exits.
I notice one thing that is macro `HAVE_SYS_AHAFS_EVPRODS_H` seems not define in CMake repo but is required by libuv:
[libuv](https://github.com/libuv/libuv/blob/v1.x/uv.gyp#L308)
[cmlibuv](https://github.com/Kitware/CMake/blob/07cfb18f9d29cfc0588ede928846a03ec5599c48/Utilities/cmlibuv/CMakeLists.txt#L126)
So that it cannot step in the `#ifdef` block in `aix.c`:
[aix.c](https://github.com/Kitware/CMake/blob/07cfb18f9d29cfc0588ede928846a03ec5599c48/Utilities/cmlibuv/src/unix/aix.c#L780)
and end up with `assert(0)` here:
[core.c](https://github.com/Kitware/CMake/blob/master/Utilities/cmlibuv/src/unix/core.c#L185)
Using flag `--system-libuv` in bootstrap can force cmake to use system libuv, but building cmake in default way may cause issue?
I am wondering whether it was designed for any purpose? Or do I miss something important?https://gitlab.kitware.com/cmake/cmake/-/issues/17636XL: Add options to choose beween 64-bit and 32-bit builds2018-01-12T12:01:36-05:00Brad KingXL: Add options to choose beween 64-bit and 32-bit buildsAs discussed in !1644 CMake has no first-class way to specify 64-bit builds with XL tools. Currently it can only be done reliably by setting the `OBJECT_MODE` environment variable. The compiler, linker, and archiver all have flags that...As discussed in !1644 CMake has no first-class way to specify 64-bit builds with XL tools. Currently it can only be done reliably by setting the `OBJECT_MODE` environment variable. The compiler, linker, and archiver all have flags that CMake would need to add in the proper places (e.g. `-q64` and `-X 64`).https://gitlab.kitware.com/cmake/cmake/-/issues/16818enabling pthreads on AIX fails2020-08-12T10:39:42-04:00Florian Apollonerenabling pthreads on AIX failsI minimized my problem to the simplest reproducible project: https://github.com/apollo13/cmake_aix_bug
The issue is as follows:
* GCC on AIX (at least in my variant), comes with multiple stdlibs: http://www.perzl.org/aix/index.php...I minimized my problem to the simplest reproducible project: https://github.com/apollo13/cmake_aix_bug
The issue is as follows:
* GCC on AIX (at least in my variant), comes with multiple stdlibs: http://www.perzl.org/aix/index.php%3Fn%3DMain.GCCBinariesVersionNeutral
* Enabling -pthread via CMake results in a executable that links against the wrong stdlib (namely the one without pthread).
* exporting LIBPATH to the pthread variant makes the program work again.
See the following examples:
Compile **with** pthread:
```
/usr/bin/c++ -v -Wl,-bnoipath -Wl,-brtl CMakeFiles/Test.dir/main.cpp.o CMakeFiles/Test.dir/easylogging++.cpp.o -o Test -pthread
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
COLLECT_LTO_WRAPPER=/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/lto-wrapper
Target: powerpc-ibm-aix6.1.0.0
Configured with: ../gcc-4.8.5/configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran --prefix=/opt/freeware --mandir=/opt/freeware/man --infodir=/opt/freeware/info --enable-version-specific-runtime-libs --disable-nls --enable-decimal-float=dpd --with-cloog=no --with-ppl=no --disable-libstdcxx-pch --enable-__cxa_atexit --host=powerpc-ibm-aix6.1.0.0
Thread model: aix
gcc version 4.8.5 (GCC)
COMPILER_PATH=/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/:/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/:/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/
LIBRARY_PATH=/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/pthread/:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/../../../pthread/:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'Test' '-pthread' '-shared-libgcc'
/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/collect2 -bpT:0x10000000 -bpD:0x20000000 -btextro -bnodelcsect -o Test /lib/crt0_r.o /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/pthread/crtcxa.o -L/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/pthread -L/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/../../../pthread -L/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5 -L/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/../../.. -bnoipath -brtl CMakeFiles/Test.dir/main.cpp.o CMakeFiles/Test.dir/easylogging++.cpp.o -lstdc++ -lm -lgcc_s /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/pthread/libgcc.a -lpthreads -lc -lgcc_s /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/pthread/libgcc.a
```
Compile **without** pthread:
```
a700tj05*therhall*>/usr/bin/c++ -v -Wl,-bnoipath -Wl,-brtl CMakeFiles/Test.dir/main.cpp.o CMakeFiles/Test.dir/easylogging++.cpp.o -o Test
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
COLLECT_LTO_WRAPPER=/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/lto-wrapper
Target: powerpc-ibm-aix6.1.0.0
Configured with: ../gcc-4.8.5/configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran --prefix=/opt/freeware --mandir=/opt/freeware/man --infodir=/opt/freeware/info --enable-version-specific-runtime-libs --disable-nls --enable-decimal-float=dpd --with-cloog=no --with-ppl=no --disable-libstdcxx-pch --enable-__cxa_atexit --host=powerpc-ibm-aix6.1.0.0
Thread model: aix
gcc version 4.8.5 (GCC)
COMPILER_PATH=/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/:/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/:/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/
LIBRARY_PATH=/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'Test' '-shared-libgcc'
/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/collect2 -bpT:0x10000000 -bpD:0x20000000 -btextro -bnodelcsect -o Test /lib/crt0.o /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/crtcxa.o -L/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5 -L/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/../../.. -bnoipath -brtl CMakeFiles/Test.dir/main.cpp.o CMakeFiles/Test.dir/easylogging++.cpp.o -lstdc++ -lm -lgcc_s /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/libgcc.a -lc -lgcc_s /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/libgcc.a
```
As you can see, LIBRARY_PATH is different depending on whether pthread is used or not. If I am using cmake to compile the project I get:
```
c++ -v -Wl,-bnoipath -Wl,-brtl CMakeFiles/Test.dir/main.cpp.o CMakeFiles/Test.dir/easylogging++.cpp.o -o Test -Wl,-blibpath:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5:/opt/freeware/lib:/usr/lib:/lib -pthread
Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/lto-wrapper
Target: powerpc-ibm-aix6.1.0.0
Configured with: ../gcc-4.8.5/configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran --prefix=/opt/freeware --mandir=/opt/freeware/man --infodir=/opt/freeware/info --enable-version-specific-runtime-libs --disable-nls --enable-decimal-float=dpd --with-cloog=no --with-ppl=no --disable-libstdcxx-pch --enable-__cxa_atexit --host=powerpc-ibm-aix6.1.0.0
Thread model: aix
gcc version 4.8.5 (GCC)
COMPILER_PATH=/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/:/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/:/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/
LIBRARY_PATH=/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/pthread/:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/../../../pthread/:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'Test' '-pthread' '-shared-libgcc'
/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/collect2 -bpT:0x10000000 -bpD:0x20000000 -btextro -bnodelcsect -o Test /lib/crt0_r.o /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/pthread/crtcxa.o -L/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/pthread -L/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/../../../pthread -L/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5 -L/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/../../.. -bnoipath -brtl CMakeFiles/Test.dir/main.cpp.o CMakeFiles/Test.dir/easylogging++.cpp.o -blibpath:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5:/opt/freeware/lib:/usr/lib:/lib -lstdc++ -lm -lgcc_s /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/pthread/libgcc.a -lpthreads -lc -lgcc_s /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/pthread/libgcc.a
```
This means by adding *-Wl,-blibpath:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5:/opt/freeware/lib:/usr/lib:/lib* (which is done by CMake) my program has the wrong stdlib.
The only solution I could come up with is:
```
set(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH "")
set(CMAKE_CXX_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH 0)
```
Is there any way to specify pthread in a way so that it affects compiler identifactions?
/cc @chuck.atkins - Do you have any ideas on that?https://gitlab.kitware.com/cmake/cmake/-/issues/16683CMake Can't be used for AIX with GNU ld (cross-compilation)2017-10-13T13:17:55-04:00Byoungchan LeeCMake Can't be used for AIX with GNU ld (cross-compilation)I'm trying to setup AIX cross-compile tool using GCC (4.8) and GNU Binutils (2.24) on Linux Host.
When I Use CMake 2.8,7 (Ubuntu 12.04), it can be used for compile C++ programs without any problems.
However, when I use CMake 3.5.1 (U...I'm trying to setup AIX cross-compile tool using GCC (4.8) and GNU Binutils (2.24) on Linux Host.
When I Use CMake 2.8,7 (Ubuntu 12.04), it can be used for compile C++ programs without any problems.
However, when I use CMake 3.5.1 (Ubuntu 16.04), it can't link C++ Programs.
```
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_49385.dir/link.txt
--verbose=1
/home/leebc/toolchain/aix/gcc4.8/bin/powerpc-ibm-aix5.3.0.0-g++
-Wl,-bnoipath -Wl,-brtl CMakeFiles/cmTC_49385.dir/testCXXCompiler.cxx.o -o
cmTC_49385 -Wl,-blibpath:/usr/lib:/lib
/home/leebc/toolchain/aix/gcc4.8/lib/gcc/powerpc-ibm-aix5.3.0.0/4.8.2/../../../../powerpc-ibm-aix5.3.0.0/bin/ld:
target noipath not found
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_49385.dir/build.make:97: recipe for target 'cmTC_49385'
failed
make[1]: *** [cmTC_49385] Error 1
make[1]: Leaving directory
'/home/leebc/myproj/CMakeFiles/CMakeTmp'
```
If I rollback this [commit](https://github.com/Kitware/CMake/commit/767a7ad9dac20d252e71941b6cf03f123c7c37fc), it works fine. Seems like `bnoipath` flag works only for AIX ld, which cannot be used on cross-compilation.https://gitlab.kitware.com/cmake/cmake/-/issues/15607Lack of 64bit support (AIX / XL compiler)2017-10-13T13:17:56-04:00Kitware RobotLack of 64bit support (AIX / XL compiler)This issue was created automatically from an original [Mantis Issue](https://cmake.org/Bug/view.php?id=15607). Further discussion may take place here.This issue was created automatically from an original [Mantis Issue](https://cmake.org/Bug/view.php?id=15607). Further discussion may take place here.https://gitlab.kitware.com/cmake/cmake/-/issues/14304Installing targets doesn't create links with versions2017-10-13T13:18:31-04:00Kitware RobotInstalling targets doesn't create links with versionsThis issue was created automatically from an original [Mantis Issue](https://cmake.org/Bug/view.php?id=14304). Further discussion may take place here.This issue was created automatically from an original [Mantis Issue](https://cmake.org/Bug/view.php?id=14304). Further discussion may take place here.https://gitlab.kitware.com/cmake/cmake/-/issues/13331AIX linker chokes on spaces in rpath2017-10-13T13:18:31-04:00Kitware RobotAIX linker chokes on spaces in rpathThis issue was created automatically from an original [Mantis Issue](https://cmake.org/Bug/view.php?id=13331). Further discussion may take place here.This issue was created automatically from an original [Mantis Issue](https://cmake.org/Bug/view.php?id=13331). Further discussion may take place here.