[openssl-users] Building OpenSSL on Linux , undefined reference to 'main'

Rob Hermann rhermann at centonline.com
Mon Feb 15 20:55:09 UTC 2016


To follow up with a bit more detail

The version of OpenSSL is 1.0.2e.

The exact steps inside of my Linux environment that I take are

1) log in as su.
2) run "make clean"
3) run "sh config zlib"
the last line logged from this command is
"Configured for linux-elf"

4) run "make"

the make gets as far as

make[2]: Entering directory `/home/rhermann/src/OpenSSLWork/test'
( :; LIBDEPS="${LIBDEPS:--L.. -lssl -L.. -lcrypto  -ldl -lz}"; 
LDCMD="${LDCMD:-gcc}"; LDFLAGS="${LDFLAGS:--DZLIB -DOPENSSL_THREADS 
-D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -O3 
-fomit-frame-pointer -Wall -DOPENSSL_BN_ASM_PART_WORDS 
-DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m 
-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM 
-DVPAES_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:=ideatest} ideatest.o ${LIBDEPS} )
make[2]: Leaving directory `/home/rhermann/src/OpenSSLWork/test'
gcc -I.. -I../include  -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN 
-DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -O3 -fomit-frame-pointer 
-Wall -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 
-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM 
-DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM 
-DWHIRLPOOL_ASM -DGHASH_ASM   -c -o md2test.o md2test.c
make[2]: Entering directory `/home/rhermann/src/OpenSSLWork/test'
( :; LIBDEPS="${LIBDEPS:--L.. -lssl -L.. -lcrypto  -ldl -lz}"; 
LDCMD="${LDCMD:-gcc}"; LDFLAGS="${LDFLAGS:--DZLIB -DOPENSSL_THREADS 
-D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -O3 
-fomit-frame-pointer -Wall -DOPENSSL_BN_ASM_PART_WORDS 
-DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m 
-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM 
-DVPAES_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:=md2test} md2test.o ${LIBDEPS} )
/usr/lib/gcc/i686-redhat-linux/4.4.7/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make[2]: *** [link_app.] Error 1
make[2]: Leaving directory `/home/rhermann/src/OpenSSLWork/test'
make[1]: *** [md2test] Error 2
make[1]: Leaving directory `/home/rhermann/src/OpenSSLWork/test'
make: *** [build_tests] Error 1


it  does make it through build bntest.o,  ectest.o , ecdsatest,o, 
ecdhtest.o, and ideatest.o




On 2/15/2016 1:59 PM, Rob Hermann wrote:
>
> I'm attempting to build OpenSSL on a Linux box, when I issue the make 
> from my OpenSSL directory (OpenSSLWork as seen here),   It builds all 
> the subdirectories under crypto,
> then proceeds to
>
> OpenSSLWork/engines
> OpenSSLWork/ssl
> OpenSSLWork/apps
>
> OpenSSLWork/test
>
>
> making all in test...
> make[1]: Entering directory `/home/rhermann/src/OpenSSLWork/test'
> make[2]: Entering directory `/home/rhermann/src/OpenSSLWork/test'
> ( :; LIBDEPS="${LIBDEPS:--L.. -lssl -L.. -lcrypto  -ldl}"; 
> LDCMD="${LDCMD:-gcc}"; LDFLAGS="${LDFLAGS:--DOPENSSL_THREADS 
> -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN 
> -O3 -fomit-frame-pointer -Wall -DOPENSSL_BN_ASM_PART_WORDS 
> -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m 
> -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM 
> -DVPAES_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:=md2test} md2test.o ${LIBDEPS} )
> _/usr/lib/gcc/i686-redhat-linux/4.4.7/../../../crt1.o: In function 
> `_start':__
> __(.text+0x18): undefined reference to `main'__
> _collect2: ld returned 1 exit status
> make[2]: *** [link_app.] Error 1
> make[2]: Leaving directory `/home/rhermann/src/OpenSSLWork/test'
> make[1]: *** [md2test] Error 2
> make[1]: Leaving directory `/home/rhermann/src/OpenSSLWork/test'
> make: *** [build_tests] Error 1
>
> I know this means I'm missing the main() function the entry point for 
> all C programs.
> I'm trying to build OpenSSL using the procedures outlined in the 
> INSTALL document,  Has anyone seen this before and if so, what have 
> you done to "fix" it ?
>
> I've tried -nostartfiles as a linker option and that did not help.
>
>
>
>
>
>
>
>
>
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20160215/ef6fe676/attachment.html>


More information about the openssl-users mailing list