[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] understanding the CMake build
From: |
Thomas Chust |
Subject: |
Re: [Chicken-users] understanding the CMake build |
Date: |
Tue, 12 Sep 2006 12:37:53 +0000 (GMT) |
On Mon, 11 Sep 2006, Brandon J. Van Every wrote:
[...] But, we'll see if my INCLUDE_DIRECTORIES bulletproofing has any
effect on this problem. [...]
Hello,
I just pulled the latest changes using darcs and rebuilt
{chicken,csi}-static with CMake -- I still get dynamically linked
executables.
I observed that the command issued by CMake to link e.g. chicken-static
reads
/usr/bin/gcc -Os -DNDEBUG -headerpad_max_install_names -fPIC \
"CMakeFiles/chicken-static.dir/batch-driver.o" \
"CMakeFiles/chicken-static.dir/c-backend.o" \
"CMakeFiles/chicken-static.dir/c-platform.o" \
"CMakeFiles/chicken-static.dir/chicken.o" \
"CMakeFiles/chicken-static.dir/compiler.o" \
"CMakeFiles/chicken-static.dir/optimizer.o" \
"CMakeFiles/chicken-static.dir/support.o" \
-o chicken-static \
-L/Users/murphy/Build/chicken/static -lchicken \
-ldl -lffi -lm
[linebreaks and backslashes inserted for better readability]
I *know* that this cannot work as desired on MacOS X. The reason is, that
the MacOS X linker does scan the path in the -L option before all other
paths all right, but it *always scans the full library path first for a
shared library* when processing the -l options. As there is a
libchicken.dylib in /usr/local/lib, this results in dynamic linkage.
The only reliable way to fix this that I can think of is to specify the
full path to the static library instead of giving an -l option for it.
The following command would be the correct one for my system:
/usr/bin/gcc -Os -DNDEBUG -headerpad_max_install_names -fPIC \
"CMakeFiles/chicken-static.dir/batch-driver.o" \
"CMakeFiles/chicken-static.dir/c-backend.o" \
"CMakeFiles/chicken-static.dir/c-platform.o" \
"CMakeFiles/chicken-static.dir/chicken.o" \
"CMakeFiles/chicken-static.dir/compiler.o" \
"CMakeFiles/chicken-static.dir/optimizer.o" \
"CMakeFiles/chicken-static.dir/support.o" \
-o chicken-static \
/Users/murphy/Build/chicken/static/libchicken.a \
/usr/local/lib/libffi.a \
-lm
Note that it's also advisable to link the non-standard libffi statically
and that it makes no sense to include the dynamic loader library in a
(partially) statically linked executable because CHICKEN will not allow
the loading of dynamic code into such an executable anyway and I know that
it will also break the linked executable on some Linux systems.
Unfortunately I can't check whether making the necessary changes to
CMakeLists.txt won't break the build on other systems, so I better don't
touch anything. I vaguely remeber that some Unix dialect I've worked with
wasn't at all happy with full static library paths on the linker command
line...
cu,
Thomas
- Re: [Chicken-users] understanding the CMake build, (continued)
- Re: [Chicken-users] understanding the CMake build, Thomas Chust, 2006/09/10
- Re: [Chicken-users] understanding the CMake build, Brandon J. Van Every, 2006/09/10
- Re: [Chicken-users] understanding the CMake build, Thomas Chust, 2006/09/10
- Re: [Chicken-users] understanding the CMake build, Brandon J. Van Every, 2006/09/10
- Re: [Chicken-users] understanding the CMake build, Thomas Chust, 2006/09/10
- Re: [Chicken-users] understanding the CMake build, Brandon J. Van Every, 2006/09/10
- Re: [Chicken-users] understanding the CMake build, Thomas Chust, 2006/09/11
- Re: [Chicken-users] understanding the CMake build, Brandon J. Van Every, 2006/09/11
- Re: [Chicken-users] understanding the CMake build, Thomas Chust, 2006/09/12
- Re: [Chicken-users] understanding the CMake build, Brandon J. Van Every, 2006/09/13
- Re: [Chicken-users] understanding the CMake build,
Thomas Chust <=
- [Chicken-users] Darcs ChangeLog, Brandon J. Van Every, 2006/09/10
- Re: [Chicken-users] Darcs ChangeLog, Thomas Chust, 2006/09/10
- Re: [Chicken-users] Darcs ChangeLog, Brandon J. Van Every, 2006/09/10
- Re: [Chicken-users] CMake problem on Linux should be solved, felix winkelmann, 2006/09/10
- Re: [Chicken-users] CMake problem on Linux should be solved, Brandon J. Van Every, 2006/09/08
- Re: [Chicken-users] CMake problem on Linux should be solved, felix winkelmann, 2006/09/10
- Re: [Chicken-users] CMake problem on Linux should be solved, Brandon J. Van Every, 2006/09/08
- Re: [Chicken-users] CMake problem on Linux should be solved, John Cowan, 2006/09/08
[Chicken-users] Re: CMake problem on Linux should be solved, William A. Hoffman, 2006/09/10