[Openswan dev] PATCH: alignment error messages (fwd)

Paul Wouters paul at xelerance.com
Sun May 16 21:45:50 CEST 2004

Hugh's message below applies to freeswan and openswan-2.1.2rc5 and below.

Openswan-1 and Openswan-2 HEAD doesn't have this bit of code. I am not
entirely sure if struct encrypt_desc crypto_get_encrypter(int alg) would
suffer the same problem.

Michael, can you take a look at that? I will try and compile HEAD for MIPS
in a few days and see if I get any of these errors.

thanks Hugh!


---------- Forwarded message ----------
Date: Sat, 15 May 2004 23:15:59 -0400 (EDT)
From: D. Hugh Redelmeier <hugh at mimosa.com>
Cc: FreeS/WAN Design <design at lists.freeswan.org>
To: Paul Wouters <paul at xtdnet.nl>
Subject: alignment error messages

Paul got several errors like this when he tried to build Openswan for
the MIPS architecture:

/usr/local/linksys/openwrt/buildroot/buildroot/build_mipsel/staging_dir/bin/mipsel-linux-uclibc-ld: Warning: alignment 8 of symbol `oakley_encrypter' in crypto.o is smaller than 16 in state.o

This message is mysterious since the symbol oakley_encrypter is not
used in state.c.  This applied for all the other messages too.

It turns out that the message has pretty much nothing to do with what
is wrong: a missing "extern" in the declaration of oakley_encrypter in
crypto.h.  (As a C geek, I have some inkling of why it printed this
message, but I still think the connection to the problem is tenuous.)

I've enclosed a patch to FreeS/WAN's programs/pluto/crypto.h.  I no
longer have CVS access so I cannot check in this fix.  I expect
that the fix should also apply to Openswan and StrongS/WAN.

Hugh Redelmeier
hugh at mimosa.com  voice: +1 416 482-8253

--- crypto.h.OLD	2002-04-24 03:35:47.000000000 -0400
+++ crypto.h	2004-05-15 23:10:07.000000000 -0400
@@ -48,7 +48,7 @@
     void (*crypt)(bool enc, void *buf, size_t buf_len, struct state *st);
-const struct encrypt_desc oakley_encrypter[OAKLEY_CAST_CBC + 1];
+extern const struct encrypt_desc oakley_encrypter[OAKLEY_CAST_CBC + 1];
 #define update_iv(st)	memcpy((st)->st_iv, (st)->st_new_iv \
     , (st)->st_iv_len = (st)->st_new_iv_len)
------------ Output from pgp ------------
Good signature made 2004-05-16 03:16 GMT by key:
  1024 bits, Key ID CC6A7199, Created 1997-10-29
   "D. Hugh Redelmeier <hugh at mimosa.com>"
WARNING: The signing key is not trusted to belong to:
D. Hugh Redelmeier <hugh at mimosa.com>

More information about the Dev mailing list