libheif icon indicating copy to clipboard operation
libheif copied to clipboard

Failed to make with pie

Open huishaoli opened this issue 2 years ago • 1 comments

./configure CXXFLAGS='-fopenmp -g -O2 -Wl,-z,relro,-z,now -fPIC -fPIE -pie -fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2' --enable-shared --disable-static

The -pie option has been added, and the compilation will fail.

The error msg is: /usr/lib64/libc_nonshared.a(elf-init.oS): In function __libc_csu_init': (.text+0x14): undefined reference to __init_array_start' /usr/bin/ld: /usr/lib64/libc_nonshared.a(elf-init.oS): relocation R_X86_64_PC32 against undefined hidden symbol `__init_array_start' can not be used when making a shared object /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status make[2]: *** [libheif.la] Error 1

Has anyone encountered?

huishaoli avatar Jul 05 '22 02:07 huishaoli

The autoconf / configure approach is no longer supported. I just tried adding -pie and -fPIE -pie as build options via CMAKE_CXX_FLAGS and it compiled OK and the tests run.

Does that meet your needs?

bradh avatar Jun 09 '23 07:06 bradh