aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2021-11-17 17:24:32 +0000
committerLibravatar GitHub <noreply@github.com>2021-11-17 18:24:32 +0100
commit9abb0a89ae66df0ead136ec6cc14eea302e6a074 (patch)
tree98ae30494e0c435e68cae8a0ccaebf23e535a089
parentzsh-comp: update description of machine-id to match --help (diff)
downloadfirejail-9abb0a89ae66df0ead136ec6cc14eea302e6a074.tar.gz
firejail-9abb0a89ae66df0ead136ec6cc14eea302e6a074.tar.zst
firejail-9abb0a89ae66df0ead136ec6cc14eea302e6a074.zip
build: Stop linking pthread (#4695)
Added on commit 137985136 ("Baseline firejail 0.9.28", 2015-08-08). See also commit ad6bb83fa ("consolidate makefiles", 2018-03-31). It is not used anywhere. And it looks like it has never been used anywhere: $ git log --oneline -Gpthread.h 137985136..master $ Issue mentioned by @rusty-snake: https://github.com/netblue30/firejail/issues/4642#issuecomment-955795463
-rwxr-xr-xconfigure99
-rw-r--r--configure.ac6
-rw-r--r--src/common.mk.in2
3 files changed, 1 insertions, 106 deletions
diff --git a/configure b/configure
index 557f5beb2..747769fb1 100755
--- a/configure
+++ b/configure
@@ -1533,52 +1533,6 @@ fi
1533 1533
1534} # ac_fn_c_try_compile 1534} # ac_fn_c_try_compile
1535 1535
1536# ac_fn_c_try_link LINENO
1537# -----------------------
1538# Try to link conftest.$ac_ext, and return whether this succeeded.
1539ac_fn_c_try_link ()
1540{
1541 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1542 rm -f conftest.$ac_objext conftest$ac_exeext
1543 if { { ac_try="$ac_link"
1544case "(($ac_try" in
1545 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1546 *) ac_try_echo=$ac_try;;
1547esac
1548eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1549$as_echo "$ac_try_echo"; } >&5
1550 (eval "$ac_link") 2>conftest.err
1551 ac_status=$?
1552 if test -s conftest.err; then
1553 grep -v '^ *+' conftest.err >conftest.er1
1554 cat conftest.er1 >&5
1555 mv -f conftest.er1 conftest.err
1556 fi
1557 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1558 test $ac_status = 0; } && {
1559 test -z "$ac_c_werror_flag" ||
1560 test ! -s conftest.err
1561 } && test -s conftest$ac_exeext && {
1562 test "$cross_compiling" = yes ||
1563 test -x conftest$ac_exeext
1564 }; then :
1565 ac_retval=0
1566else
1567 $as_echo "$as_me: failed program was:" >&5
1568sed 's/^/| /' conftest.$ac_ext >&5
1569
1570 ac_retval=1
1571fi
1572 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1573 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1574 # interfere with the next link command; also delete a directory that is
1575 # left behind by Apple's compiler. We do this before executing the actions.
1576 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1577 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1578 as_fn_set_status $ac_retval
1579
1580} # ac_fn_c_try_link
1581
1582# ac_fn_c_try_cpp LINENO 1536# ac_fn_c_try_cpp LINENO
1583# ---------------------- 1537# ----------------------
1584# Try to preprocess conftest.$ac_ext, and return whether this succeeded. 1538# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
@@ -3938,51 +3892,6 @@ if test "x$enable_lts" = "xyes"; then :
3938 3892
3939fi 3893fi
3940 3894
3941
3942
3943
3944# checking pthread library
3945{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5
3946$as_echo_n "checking for main in -lpthread... " >&6; }
3947if ${ac_cv_lib_pthread_main+:} false; then :
3948 $as_echo_n "(cached) " >&6
3949else
3950 ac_check_lib_save_LIBS=$LIBS
3951LIBS="-lpthread $LIBS"
3952cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3953/* end confdefs.h. */
3954
3955
3956int
3957main ()
3958{
3959return main ();
3960 ;
3961 return 0;
3962}
3963_ACEOF
3964if ac_fn_c_try_link "$LINENO"; then :
3965 ac_cv_lib_pthread_main=yes
3966else
3967 ac_cv_lib_pthread_main=no
3968fi
3969rm -f core conftest.err conftest.$ac_objext \
3970 conftest$ac_exeext conftest.$ac_ext
3971LIBS=$ac_check_lib_save_LIBS
3972fi
3973{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_main" >&5
3974$as_echo "$ac_cv_lib_pthread_main" >&6; }
3975if test "x$ac_cv_lib_pthread_main" = xyes; then :
3976 cat >>confdefs.h <<_ACEOF
3977#define HAVE_LIBPTHREAD 1
3978_ACEOF
3979
3980 LIBS="-lpthread $LIBS"
3981
3982else
3983 as_fn_error $? "*** POSIX thread support not installed ***" "$LINENO" 5
3984fi
3985
3986ac_ext=c 3895ac_ext=c
3987ac_cpp='$CPP $CPPFLAGS' 3896ac_cpp='$CPP $CPPFLAGS'
3988ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 3897ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4380,14 +4289,6 @@ fi
4380done 4289done
4381 4290
4382 4291
4383ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
4384if test "x$ac_cv_header_pthread_h" = xyes; then :
4385
4386else
4387 as_fn_error $? "*** POSIX thread support not installed ***" "$LINENO" 5
4388fi
4389
4390
4391ac_fn_c_check_header_mongrel "$LINENO" "linux/seccomp.h" "ac_cv_header_linux_seccomp_h" "$ac_includes_default" 4292ac_fn_c_check_header_mongrel "$LINENO" "linux/seccomp.h" "ac_cv_header_linux_seccomp_h" "$ac_includes_default"
4392if test "x$ac_cv_header_linux_seccomp_h" = xyes; then : 4293if test "x$ac_cv_header_linux_seccomp_h" = xyes; then :
4393 4294
diff --git a/configure.ac b/configure.ac
index fc5823143..5ef97cbd0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -291,12 +291,6 @@ AS_IF([test "x$enable_lts" = "xyes"], [
291 AC_SUBST(HAVE_CONTRIB_INSTALL) 291 AC_SUBST(HAVE_CONTRIB_INSTALL)
292]) 292])
293 293
294
295
296
297# checking pthread library
298AC_CHECK_LIB([pthread], [main], [], AC_MSG_ERROR([*** POSIX thread support not installed ***]))
299AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not installed ***]))
300AC_CHECK_HEADER([linux/seccomp.h],,AC_MSG_ERROR([*** SECCOMP support is not installed (/usr/include/linux/seccomp.h missing) ***])) 294AC_CHECK_HEADER([linux/seccomp.h],,AC_MSG_ERROR([*** SECCOMP support is not installed (/usr/include/linux/seccomp.h missing) ***]))
301 295
302# set sysconfdir 296# set sysconfdir
diff --git a/src/common.mk.in b/src/common.mk.in
index d117433dc..c8329e7c2 100644
--- a/src/common.mk.in
+++ b/src/common.mk.in
@@ -44,7 +44,7 @@ CFLAGS += -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDI
44MANFLAGS = $(HAVE_LTS) $(HAVE_OUTPUT) $(HAVE_X11) $(HAVE_PRIVATE_HOME) $(HAVE_APPARMOR) $(HAVE_OVERLAYFS) $(HAVE_USERTMPFS) $(HAVE_DBUSPROXY) $(HAVE_FIRETUNNEL) $(HAVE_GLOBALCFG) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_FILE_TRANSFER) $(HAVE_SELINUX) $(HAVE_SUID) $(HAVE_FORCE_NONEWPRIVS) 44MANFLAGS = $(HAVE_LTS) $(HAVE_OUTPUT) $(HAVE_X11) $(HAVE_PRIVATE_HOME) $(HAVE_APPARMOR) $(HAVE_OVERLAYFS) $(HAVE_USERTMPFS) $(HAVE_DBUSPROXY) $(HAVE_FIRETUNNEL) $(HAVE_GLOBALCFG) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_FILE_TRANSFER) $(HAVE_SELINUX) $(HAVE_SUID) $(HAVE_FORCE_NONEWPRIVS)
45CFLAGS += $(MANFLAGS) 45CFLAGS += $(MANFLAGS)
46CFLAGS += -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -Wformat -Wformat-security 46CFLAGS += -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -Wformat -Wformat-security
47LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now -lpthread 47LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now
48EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@ 48EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
49 49
50ifdef NO_EXTRA_CFLAGS 50ifdef NO_EXTRA_CFLAGS