Issues w/ libraries when building both hostapd and wpa_supplicant

Philip A. Prindeville philipp_subx at redfish-solutions.com
Thu Dec 17 15:20:10 EST 2009


I noticed that if I build both targets out of the same source-tree, then I end up with undefined symbols:

If I build hostap first then wpa_supplicant:


/home/philipp/kernel/build_i586/staging_dir/bin/i586-linux-uclibc-gcc --sysroot=/home/philipp/kernel/build_i586/root --sysroot=/home/philipp/kernel/build_i586/staging_dir  -o wpa_supplicant config.o notify.o eap_register.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/wpabuf.o ../src/utils/os_unix.o ../src/utils/eloop.o config_file.o ../src/rsn_supp/wpa.o ../src/rsn_supp/preauth.o ../src/rsn_supp/pmksa_cache.o ../src/rsn_supp/peerkey.o ../src/rsn_supp/wpa_ie.o ../src/common/wpa_common.o ../src/crypto/crypto_openssl.o ../src/crypto/tls_none.o  ../src/crypto/aes-unwrap.o ../src/crypto/md5.o  ../src/utils/base64.o sme.o ../src/drivers/scan_helpers.o ../src/crypto/sha1.o ../src/crypto/sha1-pbkdf2.o  wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o main.o ../src/drivers/driver_wired.o ../src/drivers/driver_nl80211.o ../src/utils/radiotap.o ../src/drivers/driver_test.o ../src/drivers/driver_none.o ../src/drivers/drivers.o ../src/l2_packet/l2_packet_linux.o -L/lib -lssl -lnl -lcrypto  
../src/common/wpa_common.o: In function `wpa_pmk_r1_to_ptk':
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/../src/common/wpa_common.c:547: undefined reference to `sha256_prf'
../src/common/wpa_common.o: In function `wpa_derive_pmk_r1':
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/../src/common/wpa_common.c:512: undefined reference to `sha256_prf'
../src/common/wpa_common.o: In function `wpa_derive_pmk_r0':
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/../src/common/wpa_common.c:446: undefined reference to `sha256_prf'
../src/common/wpa_common.o: In function `wpa_ft_mic':
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/../src/common/wpa_common.c:180: undefined reference to `omac1_aes_128'
../src/common/wpa_common.o: In function `wpa_eapol_key_mic':
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/../src/common/wpa_common.c:61: undefined reference to `omac1_aes_128'
collect2: ld returned 1 exit status
make[1]: *** [wpa_supplicant] Error 1
make[1]: Leaving directory `/home/philipp/kernel/build_i586/hostapd-2009-12-16/wpa_supplicant'
make: *** [/home/philipp/kernel/build_i586/hostapd-2009-12-16/wpa_supplicant/wpa_supplicant] Error 2



and building wpa_supplicant and then hostap:


/home/philipp/kernel/build_i586/staging_dir/bin/i586-linux-uclibc-gcc --sysroot=/home/philipp/kernel/build_i586/root --sysroot=/home/philipp/kernel/build_i586/staging_dir  -o hostapd hostapd.o main.o ieee802_1x.o config.o ieee802_11_auth.o sta_info.o wpa.o preauth.o pmksa_cache.o drv_callbacks.o tkip_countermeasures.o mlme.o wpa_auth_ie.o ../src/drivers/drivers.o ../src/drivers/scan_helpers.o ../src/utils/eloop.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/wpabuf.o ../src/utils/os_unix.o ../src/utils/ip_addr.o ../src/common/ieee802_11_common.o ../src/common/wpa_common.o ../src/eapol_auth/eapol_auth_sm.o dump_state.o ../src/eapol_auth/eapol_auth_dump.o ../src/radius/radius.o ../src/radius/radius_client.o accounting.o vlan_init.o ctrl_iface.o ctrl_iface_ap.o ../src/crypto/md5.o iapp.o peerkey.o wpa_ft.o ../src/drivers/driver_wired.o ../src/drivers/driver_nl80211.o ../src/utils/radiotap.o ../src/drivers/driver_none.o ../src/l2_packet/l2_packet_linux.o ../src/eap_server/eap_md5.o ../src/eap_server/eap_tls.o ../src/eap_server/eap_peap.o ../src/eap_common/eap_peap_common.o ../src/eap_server/eap_ttls.o ../src/eap_server/eap_mschapv2.o ../src/eap_server/eap_gtc.o ../src/eap_server/eap_sim.o ../src/eap_server/eap_aka.o ../src/eap_common/eap_sim_common.o ../src/eap_server/eap_sim_db.o ../src/eap_server/eap_pax.o ../src/eap_common/eap_pax_common.o ../src/eap_server/eap_psk.o ../src/eap_common/eap_psk_common.o ../src/eap_server/eap_sake.o ../src/eap_common/eap_sake_common.o ../src/eap_server/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o ../src/eap_server/eap_fast.o ../src/eap_common/eap_fast_common.o ../src/eap_server/eap_ikev2.o ../src/eap_server/ikev2.o ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o eap_register.o ../src/eap_server/eap.o ../src/eap_common/eap_common.o ../src/eap_server/eap_methods.o ../src/eap_server/eap_identity.o ../src/crypto/ms_funcs.o ../src/eap_common/chap.o ../src/eap_server/eap_tls_common.o ../src/crypto/tls_openssl.o ../src/crypto/crypto_openssl.o ../src/crypto/fips_prf_openssl.o  ../src/crypto/aes-wrap.o ../src/crypto/aes-eax.o ../src/crypto/aes-ctr.o ../src/crypto/aes-encblock.o ../src/crypto/aes-omac1.o ../src/crypto/aes-unwrap.o ../src/crypto/aes-cbc.o ../src/crypto/sha1.o ../src/crypto/sha1-pbkdf2.o ../src/crypto/sha1-tprf.o ../src/crypto/sha1-tlsprf.o ../src/crypto/sha256.o ../src/crypto/dh_groups.o beacon.o wme.o ap_list.o ieee802_11.o hw_features.o ieee802_11_ht.o -lnl -lssl -lcrypto
wpa_ft.o: In function `wpa_ft_generate_pmk_r1':
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/wpa_ft.c:1611: undefined reference to `wpa_derive_pmk_r1'
wpa_ft.o: In function `wpa_ft_process_auth_req':
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/wpa_ft.c:934: undefined reference to `wpa_derive_pmk_r1_name'
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/wpa_ft.c:973: undefined reference to `wpa_pmk_r1_to_ptk'
wpa_ft.o: In function `wpa_ft_rrb_rx_pull':
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/wpa_ft.c:1320: undefined reference to `wpa_derive_pmk_r1'
wpa_ft.o: In function `wpa_ft_validate_reassoc':
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/wpa_ft.c:1106: undefined reference to `wpa_ft_mic'
wpa_ft.o: In function `wpa_sm_write_assoc_resp_ies':
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/wpa_ft.c:683: undefined reference to `wpa_ft_mic'
wpa_ft.o: In function `wpa_auth_derive_ptk_ft':
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/wpa_ft.c:365: undefined reference to `wpa_derive_pmk_r0'
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/wpa_ft.c:371: undefined reference to `wpa_derive_pmk_r1'
/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/wpa_ft.c:377: undefined reference to `wpa_pmk_r1_to_ptk'
collect2: ld returned 1 exit status
make[1]: *** [hostapd] Error 1
make[1]: Leaving directory `/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd'
make: *** [/home/philipp/kernel/build_i586/hostapd-2009-12-16/hostapd/hostapd] Error 2



Is there any way to build the libraries into separate object directories, one for linking against hostap and another for wpa_supplicant?

That will save me having to do a "make -C ../src clean" before each target (application).

Thanks,

-Philip






More information about the HostAP mailing list