Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Architecture-Specific #12

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

jamesb5959
Copy link

This pull request introduces an enhancement in the Makefile to automatically detect the running architecture and select the appropriate library paths for x86 and ARM architectures. This change facilitates the build process on different environments without the need for manual configuration.

Changes made:

  • Added the x86 and arm directories in the lib/ folder to organize the architecture-specific static libraries.
  • Utilized uname -m to determine the machine's architecture dynamically.
  • Defined conditional paths for LIBMNL_PATH and LIBNFTNL_PATH to switch between x86 and arm directories based on the detected architecture.
  • Added error handling for unsupported architectures to prevent build failures.

This update ensures that the correct version of the libraries is used during the compilation process, thus making the build system more robust and platform-agnostic.

@dhje0ng
Copy link

dhje0ng commented Jul 10, 2024

Hi @jamesb5959

Same as above, I am building a library to work in ARM 32bit environment.

However, I am unable to compile it due to the below error.

I am attaching the libmnl, libnftnl build options I used and the CVE-2024-1086/Makefile.

Have you ever solved this problem?

/usr/lib/gcc-cross/arm-linux-gnueabihf/11/../../../../../arm-linux-gnueabihf/bin/ld: ./lib/arm/libmnl.a: error adding symbols: archive has no index; run ranlib to add one
LIBMNL:
./configure --build=x86_64-pc-linux-gnu --host=arm-linux-gnueabi --enable-static=no --prefix="/home/build/arm-static-build/libmnl-1.0.5/build" CPPFLAGS="-I/home/build/arm-static-build/libmnl-1.0.5/include"

LIBNFTNL:
./configure --build=x86_64-pc-linux-gnu --host=arm-linux-gnueabi --enable-static=no --prefix="/home/build/arm-static-build/libnftnl-1.2. 6/build" LIBMNL_CFLAGS="-I/home/build/arm-static-build/libmnl-1.0.5/build/include" LIBMNL_LIBS="-L/home/build/arm-static-build/libmnl-1.0.5/build/lib"

MAKEFILE:
#CC = gcc
CC = arm-linux-gnueabi-gcc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants