MrRockchip

libnl-tiny

Feb 9th, 2026
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. diff --git a/CMakeLists.txt b/CMakeLists.txt
  2. index b9e342f..f6bf618 100644
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -3,6 +3,13 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
  6. PROJECT(libnl-tiny C)
  7. INCLUDE(GNUInstallDirs)
  8.  
  9. +set(CMAKE_SYSTEM_NAME Linux)
  10. +set(CMAKE_SYSTEM_PROCESSOR x86_64)
  11. +set(CMAKE_C_COMPILER /home/artix/my-floppy-distro/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc)
  12. +set(CMAKE_SYSROOT /home/artix/my-floppy-distro/x86_64-linux-musl-cross)
  13. +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -Os -s -ffunction-sections -fdata-sections -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-stack-protector -fomit-frame-pointer -fmerge-all-constants -fno-ident -fno-math-errno -fno-unroll-loops -ffast-math -fno-plt -fvisibility=hidden -fno-exceptions -march=x86-64 -mtune=generic -fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels")
  14. +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -s -Wl,--gc-sections -Wl,--strip-all -Wl,--build-id=none -Wl,-z,norelro -Wl,--hash-style=sysv -Wl,--no-eh-frame-hdr -Wl,-z,noseparate-code -Wl,--no-undefined-version -Wl,--as-needed -Wl,--sort-common -Wl,--sort-section=alignment -Wl,--compress-debug-sections=none -Wl,--warn-common -Wl,--discard-all -Wl,--discard-locals -Wl,--no-ld-generated-unwind-info -Wl,--orphan-handling=place -no-pie")
  15. +
  16. INCLUDE_DIRECTORIES(include)
  17.  
  18. ADD_DEFINITIONS(-Wall -Werror -Wextra -Wno-unused-parameter)
  19. diff --git a/include/netlink/msg.h b/include/netlink/msg.h
  20. index f034691..3590420 100644
  21. --- a/include/netlink/msg.h
  22. +++ b/include/netlink/msg.h
  23. @@ -12,6 +12,15 @@
  24. #ifndef NETLINK_MSG_H_
  25. #define NETLINK_MSG_H_
  26.  
  27. +/*struct ucred {
  28. + pid_t pid;
  29. + uid_t uid;
  30. + gid_t gid;
  31. +};*/
  32. +
  33. +#define _GNU_SOURCE
  34. +#include <sys/socket.h> /* struct ucred is here in musl */
  35. +#include <sys/types.h> /* pid_t, uid_t, gid_t */
  36. #include <netlink/netlink.h>
  37. #include <netlink/object.h>
  38.  
  39.  
Advertisement
Add Comment
Please, Sign In to add comment