Skip to contentSkip to conversation

heimdal: explicitly set -lpthread

PATCH Superseded Ryan Coe 2 participants 4 messages Apr 21, 2015 – Apr 22, 2015

lore
Share & tools
lore

Ryan Coe

author
#0 lore raw

PATCH v2 1/1 heimdal: explicitly set -lpthread

fixes the following build error:

output/build/host-heimdal-1.5.3/lib/sqlite/.libs/libheimsqlite.a(sqlite3.o): In function `pthreadMutexTry':
sqlite3.c:(.text+0x5795): undefined reference to pthread_mutex_trylock' output/build/host-heimdal-1.5.3/lib/sqlite/.libs/libheimsqlite.a(sqlite3.o): In function pthreadMutexAlloc':
sqlite3.c:(.text+0xbf84): undefined reference to pthread_mutexattr_init' sqlite3.c:(.text+0xbf91): undefined reference to pthread_mutexattr_settype' sqlite3.c:(.text+0xbfa4): undefined reference to pthread_mutexattr_destroy' output/build/host-heimdal-1.5.3/base/.libs/libheimbase.a(heimbase.o): In function init_ar_tls':
heimbase.c:(.text+0x4f): undefined reference to pthread_key_create' output/build/host-heimdal-1.5.3/base/.libs/libheimbase.a(heimbase.o): In function autorel_tls':
heimbase.c:(.text+0x263): undefined reference to pthread_getspecific' heimbase.c:(.text+0x291): undefined reference to pthread_setspecific'
collect2: error: ld returned 1 exit status
make[3]: *** [verify_krb5_conf] Error 1
make[3]: Leaving directory `output/build/host-heimdal-1.5.3/lib/krb5'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `output/build/host-heimdal-1.5.3/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `output/build/host-heimdal-1.5.3'
make: *** [output/build/host-heimdal-1.5.3/.stamp_built] Error 2

---
Changes v1 -> v2:
- add description about build failure
- remove host-flex addition

---
 package/heimdal/heimdal.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/heimdal/heimdal.mk +1 -1
index 972f15c..fef4174 100644
@@ -10,7 +10,7 @@ HEIMDAL_DEPENDENCIES = host-e2fsprogs host-pkgconf
 HEIMDAL_INSTALL_STAGING = YES
 # static because of -fPIC issues with e2fsprogs on x86_64 host
 HOST_HEIMDAL_CONF_OPTS = --with-x=no --disable-shared --enable-static
-HOST_HEIMDAL_CONF_ENV = MAKEINFO=true
+HOST_HEIMDAL_CONF_ENV = MAKEINFO=true LIBS="-lpthread"
 HEIMDAL_MAKE = $(MAKE1)
 # For heimdal-0004-compile_et.patch
 HEIMDAL_AUTORECONF = YES
Signature · 1 line
2.3.5
#1 lore raw

PATCH v2 1/1 heimdal: explicitly set -lpthread

Dear Ryan Coe,

Quoted 22 lines · Ryan Coe

fixes the following build error:

output/build/host-heimdal-1.5.3/lib/sqlite/.libs/libheimsqlite.a(sqlite3.o): In function `pthreadMutexTry':
sqlite3.c:(.text+0x5795): undefined reference to pthread_mutex_trylock' output/build/host-heimdal-1.5.3/lib/sqlite/.libs/libheimsqlite.a(sqlite3.o): In function pthreadMutexAlloc':
sqlite3.c:(.text+0xbf84): undefined reference to pthread_mutexattr_init' sqlite3.c:(.text+0xbf91): undefined reference to pthread_mutexattr_settype' sqlite3.c:(.text+0xbfa4): undefined reference to pthread_mutexattr_destroy' output/build/host-heimdal-1.5.3/base/.libs/libheimbase.a(heimbase.o): In function init_ar_tls':
heimbase.c:(.text+0x4f): undefined reference to pthread_key_create' output/build/host-heimdal-1.5.3/base/.libs/libheimbase.a(heimbase.o): In function autorel_tls':
heimbase.c:(.text+0x263): undefined reference to pthread_getspecific' heimbase.c:(.text+0x291): undefined reference to pthread_setspecific'
collect2: error: ld returned 1 exit status
make[3]: *** [verify_krb5_conf] Error 1
make[3]: Leaving directory `output/build/host-heimdal-1.5.3/lib/krb5'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `output/build/host-heimdal-1.5.3/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `output/build/host-heimdal-1.5.3'
make: *** [output/build/host-heimdal-1.5.3/.stamp_built] Error 2

Quoted 1 line

Ok, now I understand better. It's because host-heimdal picks up host-sqlite, which we most likely don't need. Can you try instead something like this:

package/heimdal/heimdal.mk +13 -1
index 972f15c..5d27f77 100644
@@ -9,7 +9,19 @@ HEIMDAL_SITE = http://www.h5l.org/dist/src
 HEIMDAL_DEPENDENCIES = host-e2fsprogs host-pkgconf
 HEIMDAL_INSTALL_STAGING = YES
 # static because of -fPIC issues with e2fsprogs on x86_64 host
-HOST_HEIMDAL_CONF_OPTS = --with-x=no --disable-shared --enable-static
+HOST_HEIMDAL_CONF_OPTS = \
+       --disable-shared \
+       --enable-static \
+       --without-openldap \
+       --without-capng \
+       --without-sqlite3 \
+       --without-libintl \
+       --without-openssl \
+       --without-berkeley-db \
+       --without-readline \
+       --without-libedit \
+       --without-hesiod \
+       --without-x
 HOST_HEIMDAL_CONF_ENV = MAKEINFO=true
 HEIMDAL_MAKE = $(MAKE1)
 # For heimdal-0004-compile_et.patch

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
author
#2 lore raw

PATCH v2 1/1 heimdal: explicitly set -lpthread

Quoted 56 lines · Thomas Petazzoni

Dear Ryan Coe,

Quoted 22 lines · Ryan Coe

fixes the following build error:

output/build/host-heimdal-1.5.3/lib/sqlite/.libs/libheimsqlite.a(sqlite3.o): In function `pthreadMutexTry':
sqlite3.c:(.text+0x5795): undefined reference to pthread_mutex_trylock' output/build/host-heimdal-1.5.3/lib/sqlite/.libs/libheimsqlite.a(sqlite3.o): In function pthreadMutexAlloc':
sqlite3.c:(.text+0xbf84): undefined reference to pthread_mutexattr_init' sqlite3.c:(.text+0xbf91): undefined reference to pthread_mutexattr_settype' sqlite3.c:(.text+0xbfa4): undefined reference to pthread_mutexattr_destroy' output/build/host-heimdal-1.5.3/base/.libs/libheimbase.a(heimbase.o): In function init_ar_tls':
heimbase.c:(.text+0x4f): undefined reference to pthread_key_create' output/build/host-heimdal-1.5.3/base/.libs/libheimbase.a(heimbase.o): In function autorel_tls':
heimbase.c:(.text+0x263): undefined reference to pthread_getspecific' heimbase.c:(.text+0x291): undefined reference to pthread_setspecific'
collect2: error: ld returned 1 exit status
make[3]: *** [verify_krb5_conf] Error 1
make[3]: Leaving directory `output/build/host-heimdal-1.5.3/lib/krb5'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `output/build/host-heimdal-1.5.3/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `output/build/host-heimdal-1.5.3'
make: *** [output/build/host-heimdal-1.5.3/.stamp_built] Error 2

Quoted 1 line

Ok, now I understand better. It's because host-heimdal picks up host-sqlite, which we most likely don't need. Can you try instead something like this:

package/heimdal/heimdal.mk +13 -1
index 972f15c..5d27f77 100644
@@ -9,7 +9,19 @@ HEIMDAL_SITE = http://www.h5l.org/dist/src
  HEIMDAL_DEPENDENCIES = host-e2fsprogs host-pkgconf
  HEIMDAL_INSTALL_STAGING = YES
  # static because of -fPIC issues with e2fsprogs on x86_64 host
-HOST_HEIMDAL_CONF_OPTS = --with-x=no --disable-shared --enable-static
+HOST_HEIMDAL_CONF_OPTS = \
+       --disable-shared \
+       --enable-static \
+       --without-openldap \
+       --without-capng \
+       --without-sqlite3 \
+       --without-libintl \
+       --without-openssl \
+       --without-berkeley-db \
+       --without-readline \
+       --without-libedit \
+       --without-hesiod \
+       --without-x
  HOST_HEIMDAL_CONF_ENV = MAKEINFO=true
  HEIMDAL_MAKE = $(MAKE1)
  # For heimdal-0004-compile_et.patch
Quoted 3 lines

Thanks,

Thomas

Thomas,

I still get a build failure relating to a missing -lpthread with this method.

#3 lore raw

PATCH v2 1/1 heimdal: explicitly set -lpthread

Dear Ryan Coe,

Quoted 2 lines · Ryan Coe

I still get a build failure relating to a missing -lpthread with this method.

If the failure you're getting is the one you reported in the other e-mail, I already replied that it's because you didn't apply my patch. Can you retry with my patch applied, and if it fails, post somewhere the build output of the host-heimdal package?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com