View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014803CMake(No Category)public2014-03-11 09:142016-06-10 14:31
ReporterMathieu Malaterre 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0014803: support tcc + rpath
DescriptionIt would be nice to have tcc+rpath working in cmake.

Steps:
cd /tmp
$ cat l.c
int foo() { return 42; }
$ cat a.c
int main() { return foo(); }
$ tcc -shared -o libl.so l.c
$ tcc -o a a.c -Wl,-rpath=/tmp -L/tmp -ll
$ ldd a
    linux-vdso.so.1 => (0x00007fffe4087000)
    libl.so => /tmp/libl.so (0x00007f8ecce68000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8eccab8000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f8ecce6c000)
$ readelf -d a
Dynamic section at offset 0x484 contains 12 entries:
  Tag Type Name/Value
 0x0000000000000001 (NEEDED) Shared library: [libl.so]
 0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
 0x000000000000000f (RPATH) Library rpath: [/tmp]
 0x0000000000000004 (HASH) 0x8048220
 0x0000000000000005 (STRTAB) 0x80481cc
 0x0000000000000006 (SYMTAB) 0x804813c
 0x000000000000000a (STRSZ) 82 (bytes)
 0x000000000000000b (SYMENT) 24 (bytes)
 0x0000000000000007 (RELA) 0x8048250
 0x0000000000000008 (RELASZ) 96 (bytes)
 0x0000000000000009 (RELAENT) 24 (bytes)
 0x0000000000000000 (NULL) 0x0

See:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=663945 [^]

Watch out that tcc requires "-Wl,-rpath=" (not -Wl,-rpath -Wl,<some_search_path>")
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0035384)
Brad King (manager)
2014-03-11 09:30

Modules/Platform/Linux-TinyCC-C.cmake needs to be updated with the right flags.
(0035385)
Mathieu Malaterre (developer)
2014-03-11 10:07

Works for me now:

$ cat /usr/share/cmake-2.8/Modules/Platform/Linux-TinyCC-C.cmake
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "")
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-soname ")

set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath=") # -rpath
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # : or empty
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath=")
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-soname ")
set(CMAKE_EXE_EXPORTS_C_FLAG "-rdynamic")

include(Platform/UnixPaths)
(0035386)
Brad King (manager)
2014-03-11 10:13

Re 0014803:0035385: Great. Please revise it to be more minimal. Some of the settings at the top are only there to override settings from Linux.cmake, so perhaps they can be simply removed instead of set to empty and then set again.
(0042506)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2014-03-11 09:14 Mathieu Malaterre New Issue
2014-03-11 09:29 Brad King Relationship added related to 0014802
2014-03-11 09:30 Brad King Note Added: 0035384
2014-03-11 09:52 Brad King Relationship deleted related to 0014802
2014-03-11 10:07 Mathieu Malaterre Note Added: 0035385
2014-03-11 10:13 Brad King Note Added: 0035386
2016-06-10 14:29 Kitware Robot Note Added: 0042506
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team