Join us for SoftSummit 2023. The 20th anniversary of the industry leading software monetization conference. April 18 and 20. Register Now

Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 2

How to generate "" file ?

Hi all,

I want to generate from lmflex.c. Recently, I can only generate lmflex.o by editing "makefile" file.

lmflex: $(SRCDIR)/lmflex.c $(SRCDIR)/lm_code.h $(CLIENTLIB) lm_new.o
$(MAKE) lm_new.o
$(CC) -c $(CFLAGS_PIE) $(CFLAGS) $(SRCDIR)/lmflex.c
$(CC) $(CFLAGS) $(LDFLAGS_PIE) $(LDFLAGS) -o lmflex lmflex.o lm_new.o $(CLIENTLIB) $(ACTSTUB) $(XTRALIB) \
rm lmflex.o => remove this line
$(STRIP) lmflex
rm -f lm_new.o

If I use this command to build .so file, it will give an error

gcc lmflex.o -shared -o

/usr/bin/ld: lmflex.o: relocation R_X86_64_32 against `lm_job' can not be used when making a shared object; recompile with -fPIC
lmflex.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

Any ideas to solve this. Thank you !
0 Kudos
1 Reply
Flexera Alumni


I believe the default FNP toolkit comes with compiler options for "-fpic" defined as "CFLAGS". You can use the CFLAGS during compiler time (through makefile) and get the pic version for object files.

0 Kudos