Whamcloud - gitweb
Branch b_hd_newconfig
authornathan <nathan>
Thu, 14 Jul 2005 23:29:44 +0000 (23:29 +0000)
committernathan <nathan>
Thu, 14 Jul 2005 23:29:44 +0000 (23:29 +0000)
Remove the "-O2" requirement for htonl references

lnet/include/libcfs/kp30.h
lnet/klnds/socklnd/Makefile.in

index 0a7d73c..79434c3 100644 (file)
@@ -149,6 +149,18 @@ extern struct prof_ent prof_ents[MAX_PROFS];
 #define PROF_FINISH(FOO) do {} while(0)
 #endif /* PORTALS_PROFILING */
 
+/* htonl hack - either this, or compile with -O2 */
+#if defined(__GNUC__) && (__GNUC__ >= 2)
+#define ___htonl(x) __cpu_to_be32(x)
+#define ___htons(x) __cpu_to_be16(x)
+#define ___ntohl(x) __be32_to_cpu(x)
+#define ___ntohs(x) __be16_to_cpu(x)
+#define htonl(x) ___htonl(x)
+#define ntohl(x) ___ntohl(x)
+#define htons(x) ___htons(x)
+#define ntohs(x) ___ntohs(x)
+#endif
+
 /* debug.c */
 extern spinlock_t stack_backtrace_lock;
 
index f89ddb6..ffe306f 100644 (file)
@@ -2,8 +2,4 @@ MODULES := ksocknal
 
 ksocknal-objs := socknal.o socknal_cb.o socknal_modparams.o socknal_lib-linux.o
 
-# If you don't build with -O2, your modules won't insert, becahse htonl is
-# just special that way.
-EXTRA_POST_CFLAGS := -O2
-
 @INCLUDE_RULES@