The GNUmakefile has the following:

    # -fPIC is supported. Please report any breakage of -fPIC as a bug.
    # CXXFLAGS += -fPIC

Compiling a x86_64 shared object results in a compile failure if -fPIC is 
not present:

    make static dynamic cryptest.exe
    g++ -DNDEBUG -g -O2 -march=native -pipe -c 3way.cpp
    ...

    /usr/bin/ld: 3way.o: relocation R_X86_64_32S against 
`_ZTVN8CryptoPP21SimpleKeyingInterfaceE'
        can not be used when making a shared object; recompile with -fPIC
    3way.o: error adding symbols: Bad value
    collect2: error: ld returned 1 exit status

Adding -fPIC for x86_64 is as easy as:

    ifneq ($(shell uname -i | $(EGREP) -c "(_64|d64)"),0)
    CXXFLAGS += -fPIC
    endif

We want to enable -fPIC on x86_64, but not i386. That's because i386 does 
not need -fPIC for relocate-able code, and -fPIC consumes a register.

But we are not sure if it has side effects on some platforms.

QUESTION: is anyone aware of modern x86_64 compilers or platforms that 
cannot tolerate PIC? (For some reasonable definition of modern).

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to