[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1009675: GCC toolchain is broken on Debian 11 aarch64 when creating shared libraries



Hi,

чт, 14 апр. 2022 г. в 10:33, Sad Clouds <cryintothebluesky@gmail.com>:
> Create libtest.so shared library:
> gcc -O2 -fPIC -DPIC -c libtest.c && \
> gcc -O2 -fPIC -DPIC -shared -Wl,--default-symver -Wl,-soname,libtest.so.
> 1 -o libtest.so.1.0 libtest.o && \ ln -sf libtest.so.1.0 libtest.so
>
> Create main executable, linking it with libtest.so:
> gcc -O2 -c main.c && \
> gcc -O2 -L./ -ltest -o main main.c

If you change the order and put dependencies after the dependents,
linking works:

gcc -O2 -o main main.o -L./ -ltest

-- 
With best wishes
Dmitry


Reply to: