7

I'm not sure what to do here, I ran make and got this:

make[2]: Entering directory `/tmp/openssl-1.0.1/test'
( :; LIBDEPS="${LIBDEPS:--L.. -lssl -L.. -lcrypto  -ldl}"; LDCMD="${LDCMD:-gcc}"; LDFLAGS="${LDFLAGS:--DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -fno-exceptions -Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM}"; LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=rc4test} rc4test.o ${LIBDEPS} )
rc4test.o: In function `main':
rc4test.c:(.text+0x30): undefined reference to `OPENSSL_cpuid_setup'
collect2: ld returned 1 exit status
make[2]: *** [link_app.] Error 1
make[2]: Leaving directory `/tmp/openssl-1.0.1/test'
make[1]: *** [rc4test] Error 2
make[1]: Leaving directory `/tmp/openssl-1.0.1/test'
make: *** [build_tests] Error 1

I think this is a gcc thing, but I am not sure how to approach this. Should I be compiling this manually?

5
  • 1
    What is your operating system and what arguments did you pass to ./config? Commented Jul 8, 2012 at 12:10
  • I tried a few things -fPIC, -fno-exceptions and nothing in the ./config and Debian Squeeze I know I can use apt-get, but I would rather compile my own. Commented Jul 8, 2012 at 19:12
  • No warranties, but you could try editing crypto/cryptlib.c, look for the line that contains #if !defined(OPENSSL_CPUID_SETUP) && !defined(OPENSSL_CPUID_OBJ) and remove remove the && !defined(OPENSSL_CPUID_OBJ) piece. You are in good company, see here. Commented Jul 9, 2012 at 0:30
  • "undefined reference" is a LINKER 'thing'. You've specified a function that the linker can't find in the given set of libraries. Check your spelling, check your -lxxx type library options. (And were did you get that command line?!? No, no.. I don't want to know) Commented Jul 10, 2012 at 11:32
  • @Reinier Nope, doesn't work! Thanks though! Lornix, I'll try that. Commented Jul 11, 2012 at 6:25

1 Answer 1

6

I ran into the same problem, and was able to solve it by passing adding -DOPENSSL_PIC to the config call:

./config -fPIC -DOPENSSL_PIC
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.