Good morning,
when i try to compile Development Edition, make exit with this error:
[ 94%] Linking C shared library ../../libmayaqua.so
/usr/bin/ld: 3rdparty/cpu_features/libcpu_features.a(string_view.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [src/Mayaqua/CMakeFiles/mayaqua.dir/build.make:492: libmayaqua.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:952: src/Mayaqua/CMakeFiles/mayaqua.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
I'm using this compiler on FedoraCore42:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/14/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,m2,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=/usr/share/zoneinfo --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-14.2.1-20240912/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none,amdgcn-amdhsa --enable-offload-defaulted --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.1 20240912 (Red Hat 14.2.1-3) (GCC)
How to solve? Where i can put -fPIC flag and try to recompile?
Thank you!
			
									
									
						Compilation Error of Development Edition
- 
				VincenzoVenuto
 - Posts: 5
 - Joined: Thu Jul 03, 2025 9:46 am
 
- 
				JellyVPN
 - Posts: 48
 - Joined: Sun May 25, 2014 3:37 pm
 
Re: Compilation Error of Development Edition
it's because of your VPN memory too low
use these code to use SWAP to solve your issue:
fallocate -l 4G ./_swap.swap
mkswap ./_swap.swap
chmod 0600 ./_swap.swap
swapon ./_swap.swap
			
									
									
						use these code to use SWAP to solve your issue:
fallocate -l 4G ./_swap.swap
mkswap ./_swap.swap
chmod 0600 ./_swap.swap
swapon ./_swap.swap
- 
				VincenzoVenuto
 - Posts: 5
 - Joined: Thu Jul 03, 2025 9:46 am
 
Re: Compilation Error of Development Edition
I'm sorry but it's not a RAM problem. I'm compile code on a machine with 48GB of RAM and give same results.
Error is related to shared object and need to recompile with -fPIC parameter of gcc.
The problem is how to pass the flag -fPIC trough cmake?
			
									
									
						Error is related to shared object and need to recompile with -fPIC parameter of gcc.
The problem is how to pass the flag -fPIC trough cmake?
- 
				VincenzoVenuto
 - Posts: 5
 - Joined: Thu Jul 03, 2025 9:46 am
 
Re: Compilation Error of Development Edition
Can anyone tell me how to add the -fPIC flag to the make files?
			
									
									
						- 
				VincenzoVenuto
 - Posts: 5
 - Joined: Thu Jul 03, 2025 9:46 am
 
Re: Compilation Error of Development Edition
Good morning,
after some update on github, compilation of development edition with gcc version 14.2.1 20240912 (Red Hat 14.2.1-3) (GCC) on Fedora Core 42 it went well
VPN server Development Edition work good.
Thank you all!
Vincenzo
			
									
									
						after some update on github, compilation of development edition with gcc version 14.2.1 20240912 (Red Hat 14.2.1-3) (GCC) on Fedora Core 42 it went well
VPN server Development Edition work good.
Thank you all!
Vincenzo
