[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openssl-users
Subject:    Unable to compile fips_hmac.c file
From:       Santhosh Kokala <Santhosh.Kokala () riverbed ! com>
Date:       2012-11-21 2:47:33
Message-ID: CCD17F8E.320A%skokala () riverbed ! com
[Download RAW message or body]

I am trying to compile tips_hmac.c to verify the FIPS build. But I see errors. Can \
you please let me know what needs to be done to fix this?

Errors:
gcc -c fips_hmac.c -I/usr/local/ssl/include
FIPSLD_CC=gcc /usr/local/ssl/fips-2.0/bin/fipsld -o fips_hmac fips_hmac.o \
                /usr/local/ssl/fips-2.0/lib/fipscanister.o \
                /usr/local/ssl/lib/libcrypto.a
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x2d): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x43): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x4d): undefined reference to `dlclose'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x8f): undefined reference to `dladdr'
dso_dlfcn.c:(.text+0xe9): undefined reference to `dlerror'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x451): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x528): undefined reference to `dlerror'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
dso_dlfcn.c:(.text+0x5b1): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x688): undefined reference to `dlerror'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
dso_dlfcn.c:(.text+0x6f3): undefined reference to `dlclose'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
dso_dlfcn.c:(.text+0x7d7): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x848): undefined reference to `dlclose'
dso_dlfcn.c:(.text+0x88d): undefined reference to `dlerror'
collect2: ld returned 1 exit status
make: *** [fips_hmac] Error 1

Steps I followed to build FIPS Object Module, Openssl and my application (fips_hma.c)

FIPS Object Module:

./config
make
make install

OpenSSL

./config fips
Make depend
Make
Make install


Openssl Version Output:

/usr/local/ssl/bin/openssl version -a
OpenSSL 1.0.1c-fips 10 May 2012
built on: Mon Oct 22 16:20:18 PDT 2012
platform: linux-elf
options:  bn(64,32) rc4(8x,mmx) des(ptr,risc1,16,long) idea(int) blowfish(idx)
compiler: gcc -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H \
-Wa,--noexecstack -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall \
-DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT \
-DOPENSSL_BN_ASM_GF2m -I/usr/local/ssl/fips-2.0/include -DSHA1_ASM -DSHA256_ASM \
                -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM \
                -DWHIRLPOOL_ASM -DGHASH_ASM
OPENSSLDIR: "/usr/local/ssl"



My Application I used Makefile give in the FIPS User Guide 2.0

Makefile:

CC = gcc
OPENSSLDIR = /usr/local/ssl
LIBCRYPTO = $(OPENSSLDIR)/lib/libcrypto.a
INCLUDES = -I$(OPENSSLDIR)/include
CMD     = fips_hmac
OBJS = $(CMD).o /usr/local/ssl/fips-2.0/lib/fipscanister.o

$(CMD): $(OBJS)
        FIPSLD_CC=$(CC) /usr/local/ssl/fips-2.0/bin/fipsld -o $(CMD) $(OBJS) \
$(LIBCRYPTO)

$(OBJS): $(CMD).c
        $(CC) -c $(CMD).c $(INCLUDES)
clean:
        rm $(OBJS)


[Attachment #3 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: \
after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, \
sans-serif; "> <div><br>
</div>
<div>I am trying to compile tips_hmac.c to verify the FIPS build. But I see errors. \
Can you please let me know what needs to be done to fix this?</div> <div><br>
</div>
<div>
<div><u><b>Errors:</b></u></div>
<div>
<div>gcc -c fips_hmac.c -I/usr/local/ssl/include</div>
<div>FIPSLD_CC=gcc /usr/local/ssl/fips-2.0/bin/fipsld -o fips_hmac fips_hmac.o \
/usr/local/ssl/fips-2.0/lib/fipscanister.o /usr/local/ssl/lib/libcrypto.a</div> \
<div>/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function \
`dlfcn_globallookup':</div> <div>dso_dlfcn.c:(.text&#43;0x2d): undefined reference to \
`dlopen'</div> <div>dso_dlfcn.c:(.text&#43;0x43): undefined reference to \
`dlsym'</div> <div>dso_dlfcn.c:(.text&#43;0x4d): undefined reference to \
`dlclose'</div> <div>/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function \
`dlfcn_pathbyaddr':</div> <div>dso_dlfcn.c:(.text&#43;0x8f): undefined reference to \
`dladdr'</div> <div>dso_dlfcn.c:(.text&#43;0xe9): undefined reference to \
`dlerror'</div> <div>/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function \
`dlfcn_bind_func':</div> <div>dso_dlfcn.c:(.text&#43;0x451): undefined reference to \
`dlsym'</div> <div>dso_dlfcn.c:(.text&#43;0x528): undefined reference to \
`dlerror'</div> <div>/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function \
`dlfcn_bind_var':</div> <div>dso_dlfcn.c:(.text&#43;0x5b1): undefined reference to \
`dlsym'</div> <div>dso_dlfcn.c:(.text&#43;0x688): undefined reference to \
`dlerror'</div> <div>/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function \
`dlfcn_unload':</div> <div>dso_dlfcn.c:(.text&#43;0x6f3): undefined reference to \
`dlclose'</div> <div>/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function \
`dlfcn_load':</div> <div>dso_dlfcn.c:(.text&#43;0x7d7): undefined reference to \
`dlopen'</div> <div>dso_dlfcn.c:(.text&#43;0x848): undefined reference to \
`dlclose'</div> <div>dso_dlfcn.c:(.text&#43;0x88d): undefined reference to \
`dlerror'</div> <div>collect2: ld returned 1 exit status</div>
<div>make: *** [fips_hmac] Error 1</div>
</div>
</div>
<div><br>
</div>
<div>Steps I followed to build FIPS Object Module, Openssl and my application \
(fips_hma.c)</div> <div><br>
</div>
<div><u><b>FIPS Object Module:</b></u></div>
<div><br>
</div>
<div>./config</div>
<div>make</div>
<div>make install</div>
<div><br>
</div>
<div><u><b>OpenSSL</b></u></div>
<div><br>
</div>
<div>./config fips</div>
<div>Make depend</div>
<div>Make&nbsp;</div>
<div>Make install</div>
<div><br>
</div>
<div><br>
</div>
<div><b><u>Openssl Version Output:</u></b></div>
<div><br>
</div>
<div>
<div>/usr/local/ssl/bin/openssl version -a</div>
<div>OpenSSL 1.0.1c-fips 10 May 2012</div>
<div>built on: Mon Oct 22 16:20:18 PDT 2012</div>
<div>platform: linux-elf</div>
<div>options: &nbsp;bn(64,32) rc4(8x,mmx) des(ptr,risc1,16,long) idea(int) \
blowfish(idx)&nbsp;</div> <div>compiler: gcc -DOPENSSL_THREADS -D_REENTRANT \
-DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -DTERMIO -O3 \
-fomit-frame-pointer -Wall -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 \
                -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m \
                -I/usr/local/ssl/fips-2.0/include
 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM \
-DWHIRLPOOL_ASM -DGHASH_ASM</div> <div>OPENSSLDIR: &quot;/usr/local/ssl&quot;</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>My Application I used Makefile give in the FIPS User Guide 2.0</div>
<div><br>
</div>
<div><u><b>Makefile:</b></u></div>
<div>
<div><br>
</div>
<div>
<div>CC = gcc</div>
<div>OPENSSLDIR = /usr/local/ssl</div>
<div>LIBCRYPTO = $(OPENSSLDIR)/lib/libcrypto.a</div>
<div>INCLUDES = -I$(OPENSSLDIR)/include</div>
<div>CMD &nbsp; &nbsp; = fips_hmac</div>
<div>OBJS = $(CMD).o /usr/local/ssl/fips-2.0/lib/fipscanister.o</div>
<div><br>
</div>
<div>$(CMD): $(OBJS)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; FIPSLD_CC=$(CC) /usr/local/ssl/fips-2.0/bin/fipsld \
-o $(CMD) $(OBJS) $(LIBCRYPTO)</div> <div><br>
</div>
<div>$(OBJS): $(CMD).c</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $(CC) -c $(CMD).c $(INCLUDES)</div>
<div>clean: &nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; rm $(OBJS)</div>
</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><b><u><br>
</u></b></div>
<span id="OLK_SRC_BODY_SECTION">
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: \
after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, \
sans-serif; "> <div>
<p></p>
</div>
</div>
</div>
</span>
</body>
</html>


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majordomo@openssl.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic