Here is what I did:

I first bega by configuring the OpenSSL toolkit from source, supplying
configure with the following arguments:
./Configure --prefix==/home/dclusin/Development/obvius_libs/openssl
linux-generic32 -DL_ENDIAN -static

I then edited the Makefile in OpenSSL's source directory to use my
vendor's tool chain. (/usr/local/arm/3.4/bin/arm-linux-*: gcc, ar,
ranlib)

My makefile contains the following:
CC = arm-linux-gcc
CFLAGS = -O3 -Wall -c
LFLAGS = -static

OBVIUS_LIBS = /home/dclusin/Development/obvius_libs
INCLUDES = -I./ -I$(OBVIUS_LIBS)/expat/include
-I$(OBVIUS_LIBS)/gsasl/include \
        -I$(OBVIUS_LIBS)/openssl/include/
LIBRARY_PATHS = -L$(OBVIUS_LIBS)/expat/lib/ -lexpat
-L$(OBVIUS_LIBS)/gsasl/lib/ -lgsasl \
        -L$(OBVIUS_LIBS)/openssl/lib/ -lcrypto -lssl -lpthread

objects = main.o iq.o xmpp.o xml_node.o parser.o linked_queue.o socket.o

powertalk: $(objects)
        $(CC) -o powertalk $(objects) $(LFLAGS) $(LIBRARY_PATHS)
main.o: main.c
        $(CC) $(CFLAGS) $(INCLUDES) main.c
iq.o: xmpp/iq.c
        $(CC) $(CFLAGS) $(INCLUDES) xmpp/iq.c
xmpp.o: xmpp/xmpp.c
        $(CC) $(CFLAGS) $(INCLUDES) xmpp/xmpp.c
xml_node.o: xml/xml_node.c
        $(CC) $(CFLAGS) $(INCLUDES) xml/xml_node.c
parser.o: xml/parser.c
        $(CC) $(CFLAGS) $(INCLUDES) xml/parser.c
linked_queue.o: Util/linked_queue.c
        $(CC) $(CFLAGS) $(INCLUDES) Util/linked_queue.c
socket.o: Util/socket.c
        $(CC) $(CFLAGS) $(INCLUDES) Util/socket.c
.PHONY: clean
clean:
        rm powertalk $(objects)

When I go to build it compiles fine, but linking yields the following
output:
make powertalk
arm-linux-gcc -o powertalk main.o iq.o xmpp.o xml_node.o parser.o
linked_queue.o socket.o -static
-L/home/dclusin/Development/obvius_libs/expat/lib -lexpat
-L/home/dclusin/Development/obvius_libs/gsasl/lib -lgsasl
-L/home/dclusin/Development/obvius_libs/openssl/lib -lcrypto -lssl
-lpthread
t1_enc.c:(.text+0x38): undefined reference to `HMAC_CTX_init'
t1_enc.c:(.text+0x40): undefined reference to `HMAC_CTX_init'
t1_enc.c:(.text+0x58): undefined reference to `HMAC_Init_ex'
t1_enc.c:(.text+0x70): undefined reference to `HMAC_Init_ex'
t1_enc.c:(.text+0x80): undefined reference to `HMAC_Update'
t1_enc.c:(.text+0x9c): undefined reference to `HMAC_Final'
t1_enc.c:(.text+0xb8): undefined reference to `HMAC_Final'
t1_enc.c:(.text+0xd0): undefined reference to `HMAC_Init_ex'
t1_enc.c:(.text+0xe8): undefined reference to `HMAC_Init_ex'
t1_enc.c:(.text+0xf8): undefined reference to `HMAC_Update'
/* Truncated... More undefined references to SSL stuff. */

I don't think that it an issue of the entire library not being built,
because I am able to run the OpenSSL command line utility on my target
box when I compile it. Perhaps I could be off base. Any input on this
issue is very much appreciated.

P.S. Sorry for the HTML; I turned it off in outlook.

Regards,
Daniel Clusin
EnerNOC, Inc.
(617)5328154

This email and any information disclosed in connection herewith, whether
written or oral, is the property of EnerNOC, Inc. and is intended only
for the person or entity to which it is addressed. This email may
contain information that is privileged, confidential or otherwise
protected from disclosure. Distributing or copying any information
contained in this email to anyone other than the intended recipient is
strictly prohibited.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gisle Vanem
Sent: Monday, November 05, 2007 12:14 PM
To: openssl-users@openssl.org
Subject: Re: static linking against the openssl toolkit

"Dan Clusin" <[EMAIL PROTECTED]> wrote:

> I am getting the undefined references to the OpenSSL functions in the
> link stage similar to the above posting.

(don't use HTML while posting to mailing-lists).

What does the command-line (link command) looks like?
Remember the order of libs are important.

--gv
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to