[PATCH] bsd: Add support for WPA_TRACE and WPA_TRACE_BFD

Masashi Honma honma at ictec.co.jp
Fri Jan 8 00:16:03 EST 2010


Hello.

On FreeBSD 8.0, WPA_TRACE and WPA_TRACE_BFD funcitonality build fails.
I ommit logs because it is too long.

This patch solves this issue.


diff --git a/hostapd/defconfig b/hostapd/defconfig
index f5298cd..1d28c02 100644
--- a/hostapd/defconfig
+++ b/hostapd/defconfig
@@ -32,6 +32,8 @@ CONFIG_DRIVER_HOSTAP=y
 #CONFIG_DRIVER_BSD=y
 #CFLAGS += -I/usr/local/include
 #LIBS += -L/usr/local/lib
+#LIBS_p += -L/usr/local/lib
+#LIBS_c += -L/usr/local/lib
 
 # Driver interface for no driver (e.g., RADIUS server only)
 #CONFIG_DRIVER_NONE=y
@@ -158,8 +160,16 @@ CONFIG_IPV6=y
 # This tracks use of memory allocations and other registrations and reports
 # incorrect use with a backtrace of call (or allocation) location.
 #CONFIG_WPA_TRACE=y
+# For BSD, comment out these.
+#LIBS += -lexecinfo
+#LIBS_p += -lexecinfo
+#LIBS_c += -lexecinfo
 
 # Use libbfd to get more details for developer debugging
 # This enables use of libbfd to get more detailed symbols for the backtraces
 # generated by CONFIG_WPA_TRACE=y.
 #CONFIG_WPA_TRACE_BFD=y
+# For BSD, comment out these.
+#LIBS += -lbfd -liberty -lz
+#LIBS_p += -lbfd -liberty -lz
+#LIBS_c += -lbfd -liberty -lz
diff --git a/src/utils/trace.c b/src/utils/trace.c
index 17ce224..bb3eb24 100644
--- a/src/utils/trace.c
+++ b/src/utils/trace.c
@@ -24,7 +24,11 @@ static struct dl_list active_references =
 
 #ifdef WPA_TRACE_BFD
 #include <bfd.h>
+#ifdef __linux__
 #include <demangle.h>
+#else /* __linux__ */
+#include <libiberty/demangle.h>
+#endif /* __linux__ */
 
 static char *prg_fname = NULL;
 static bfd *cached_abfd = NULL;
diff --git a/wpa_supplicant/defconfig b/wpa_supplicant/defconfig
index f88106c..8c32cb3 100644
--- a/wpa_supplicant/defconfig
+++ b/wpa_supplicant/defconfig
@@ -87,6 +87,8 @@ CONFIG_DRIVER_WEXT=y
 #CONFIG_DRIVER_BSD=y
 #CFLAGS += -I/usr/local/include
 #LIBS += -L/usr/local/lib
+#LIBS_p += -L/usr/local/lib
+#LIBS_c += -L/usr/local/lib
 
 # Driver interface for Windows NDIS
 #CONFIG_DRIVER_NDIS=y
@@ -387,8 +389,16 @@ CONFIG_PEERKEY=y
 # This tracks use of memory allocations and other registrations and reports
 # incorrect use with a backtrace of call (or allocation) location.
 #CONFIG_WPA_TRACE=y
+# For BSD, comment out these.
+#LIBS += -lexecinfo
+#LIBS_p += -lexecinfo
+#LIBS_c += -lexecinfo
 
 # Use libbfd to get more details for developer debugging
 # This enables use of libbfd to get more detailed symbols for the backtraces
 # generated by CONFIG_WPA_TRACE=y.
 #CONFIG_WPA_TRACE_BFD=y
+# For BSD, comment out these.
+#LIBS += -lbfd -liberty -lz
+#LIBS_p += -lbfd -liberty -lz
+#LIBS_c += -lbfd -liberty -lz


Regards,
Masashi Honma.


More information about the HostAP mailing list