public inbox for dwarves@vger.kernel.org
 help / color / mirror / Atom feed
* Despite `-DCMAKE_INSTALL_LIBDIR=/usr/lib` libraries installed to `/usr/usr/lib`
@ 2025-04-16 10:39 Paul Menzel
  2025-04-18 10:35 ` Alan Maguire
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Menzel @ 2025-04-16 10:39 UTC (permalink / raw)
  To: dwarves; +Cc: Ben Olson, Alan Maguire, it+dwarves~vger.kernel.org

[Cc: +Ben, +Alan]

Dear pahole folks,


To build pahole 1.30, I configure it with CMake 3.25.2

     cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib 
-DCMAKE_COLOR_MAKEFILE=OFF -DCMAKE_VERBOSE_MAKEFILE=ON 
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBBPF_EMBEDDED=OFF 
/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/source

and then build it with

     make -j300

and install it with

     make -j300 install 
DESTDIR=/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image

Unfortunately, the shared libraries are installed int `/usr` as the 
prefix seems to be prepended despite LIBDIR containing the full path:

     -- Installing: 
/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves.so.1.0.0
     -- Installing: 
/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves.so.1
     -- Installing: 
/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves.so
     -- Up-to-date: 
/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves.so.1.0.0
     -- Up-to-date: 
/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves.so.1
     -- Up-to-date: 
/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves.so
     -- Installing: 
/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves_emit.so.1.0.0
     -- Installing: 
/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves_emit.so.1
     -- Set runtime path of 
"/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves_emit.so.1.0.0" 
to ""
     -- Installing: 
/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves_emit.so
     -- Installing: 
/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves_reorganize.so.1.0.0
     -- Installing: 
/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves_reorganize.so.1
     -- Set runtime path of 
"/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves_reorganize.so.1.0.0" 
to ""
     -- Installing: 
/dev/shm/bee-pmenzel/pahole/pahole-1.30-1/image/usr/usr/lib/libdwarves_reorganize.so

Looking quickly into `CMakeLists.txt` there is

     […]
     # Use the standard library installation directory
     include(GNUInstallDirs)
     set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "libdir name")
     […]
     if (NOT DEFINED LIB_INSTALL_DIR)
         set(LIB_INSTALL_DIR 
"${EXEC_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
     endif()
     […]
     install(TARGETS codiff ctracer dtagnames pahole pdwtags
                 pfunct pglobal prefcnt scncopy syscse RUNTIME DESTINATION
                     ${CMAKE_INSTALL_PREFIX}/bin)
     install(TARGETS dwarves LIBRARY DESTINATION ${LIB_INSTALL_DIR} 
ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
     install(TARGETS dwarves dwarves_emit dwarves_reorganize LIBRARY 
DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
     install(FILES dwarves.h dwarves_emit.h dwarves_reorganize.h
                   dutil.h gobuffer.h list.h rbtree.h
                   btf_encoder.h config.h ctf.h
                   elfcreator.h elf_symtab.h hash.h libctf.h
             DESTINATION ${CMAKE_INSTALL_PREFIX}/include/dwarves/)
     install(FILES man-pages/pahole.1 DESTINATION 
${CMAKE_INSTALL_PREFIX}/share/man/man1/)

Passing `-DLIB_INSTALL_DIR=/usr/lib` to `cmake` works around this. It 
looks like it was supposed to be fixed by Ben’s commit a2abd9482162 
(CMakeList.txt: Respect CMAKE_INSTALL_LIBDIR) [1], but it doesn’t work 
for me.


Kind regards,

Paul


[1]: https://lore.kernel.org/r/Z0TtnS-0iXq1Bc-0@bolson-desk

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-18 10:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 10:39 Despite `-DCMAKE_INSTALL_LIBDIR=/usr/lib` libraries installed to `/usr/usr/lib` Paul Menzel
2025-04-18 10:35 ` Alan Maguire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox