I downloaded the libjson.so library to the musl cross compile environment (/usr/aarch64-linux-gnu//musl), which has the layout as the following:
/usr/aarch64-linux-gnu/
├── bin
├── include
│ ├── arpa
│ └── ...
├── lib
│ ├── audit
│ ├── gconv
│ └── ldscripts
├── lib64
├── musl
│ ├── include
│ └── lib
└── usr
└── bin
I also downloaded the header files to the include folder. However, I cannot compile my program:
[u@archlinux tmp.UZIJgdZKC7]$ musl-gcc t.c -ljson-c
/usr/lib/gcc/aarch64-linux-gnu/13.2.0/../../../../aarch64-linux-gnu/bin/ld: /usr/aarch64-linux-gnu/musl/lib/libjson-c.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
What might be the problem? Is it because the section headers were removed in the library?
/usr/aarch64-linux-gnu/musl/lib/libjson-c.so.5.2.0: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, no section header