relocation R_X86_64_32 against.rodata' can not be used when making a PIE object, recompile with-fPIE

106 Views Asked by At
CFLAGS=-ggdb3 -Wall -Werror -pedantic -std=gnu99 -g

GIVEN_OBJS=deck-c4.o  eval-c4.o  future.o  input.o  main.o

MY_OBJS=cards.o deck.o eval.o

test-eval: deck.o eval.o eval-c4.o test-eval.o deck-c4.o cards.o input.o future.o
    gcc -o test-eval -ggdb3 deck.o deck-c4.o eval-c4.o eval.o test-eval.o cards.o input.o future.o
   

poker: $(GIVEN_OBJS) $(MY_OBJS)
    gcc -o poker -ggdb3  $(MY_OBJS) $(GIVEN_OBJS)
clean:
    rm -f test poker cards.o my-test-main.o *~

Makefile code^

`i am trying to compile by using a command "make test-eval" but the object files show me this error

i tired using "-fPIE" but it does not work and when i use "-no-pie" in the makefile it works but gives me the wrong output

0

There are 0 best solutions below