From 798554fd923b65b9996debd368624ede67aab44e Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Tue, 2 Jan 2018 13:12:24 +0100 Subject: [PATCH] Still removing pthread patches --- common/lib/libc/gmon/mcount.c | 2 -- external/bsd/dhcp/Makefile.inc | 12 ------------ external/bsd/libevent/include/event2/event-config.h | 9 +-------- external/bsd/libevent/lib/Makefile | 3 +-- external/bsd/llvm/dist/clang/lib/Driver/Tools.cpp | 4 +--- external/bsd/llvm/link.mk | 2 +- external/public-domain/sqlite/Makefile.inc | 1 - external/public-domain/xz/bin/xz/Makefile | 2 -- external/public-domain/xz/lib/Makefile | 10 +++------- lib/Makefile | 6 +----- lib/libc/Makefile.inc | 2 +- minix/lib/libsys/stacktrace.c | 1 + sys/lib/libunwind/AddressSpace.hpp | 9 --------- sys/lib/libunwind/UnwindCursor.hpp | 2 -- tests/lib/libevent/Makefile | 8 +------- 15 files changed, 11 insertions(+), 62 deletions(-) diff --git a/common/lib/libc/gmon/mcount.c b/common/lib/libc/gmon/mcount.c index 6396d4b36..128abe6f9 100644 --- a/common/lib/libc/gmon/mcount.c +++ b/common/lib/libc/gmon/mcount.c @@ -138,7 +138,6 @@ _MCOUNT_DECL(u_long frompc, u_long selfpc) int s; #endif -#if !defined(__minix) #if defined(_REENTRANT) && !defined(_KERNEL) if (__isthreaded) { p = thr_getspecific(_gmonkey); @@ -149,7 +148,6 @@ _MCOUNT_DECL(u_long frompc, u_long selfpc) } } else #endif -#endif /* !defined(__minix) */ p = &_gmonparam; /* * check that we are profiling diff --git a/external/bsd/dhcp/Makefile.inc b/external/bsd/dhcp/Makefile.inc index f7743a7e7..09a824e37 100644 --- a/external/bsd/dhcp/Makefile.inc +++ b/external/bsd/dhcp/Makefile.inc @@ -20,21 +20,13 @@ DSTOBJDIR!=cd ${.PARSEDIR}/lib/dst && ${PRINTOBJDIR} .if (${USE_INET6} != "no") CPPFLAGS+= -DDHCPv6 .endif -.if !defined(__MINIX) CPPFLAGS+= -DISC_PLATFORM_USETHREADS -DHAVE_CONFIG_H -.else # defined(__MINIX) -CPPFLAGS+= -DHAVE_CONFIG_H -.endif # defined(__MINIX) CPPFLAGS+= -I${DIST} -I${DIST}/includes -I${DIST}/../include CPPFLAGS+= -I${BIND} -I${BIND}/includes -I${BIND}/../include .for dir in isc dns irs CPPFLAGS+= -I${BIND}/lib/${dir}/include CPPFLAGS+= -I${BIND}/lib/${dir}/unix/include -.if !defined(__MINIX) CPPFLAGS+= -I${BIND}/lib/${dir}/pthreads/include -.else # defined(__MINIX) -CPPFLAGS+= -I${BIND}/lib/${dir}/nothreads/include -.endif # defined(__MINIX) .endfor CPPFLAGS+= -DLOCALSTATEDIR='"/var"' LDADD+= ${COBJDIR}/libdhcp.a @@ -43,9 +35,7 @@ LDADD+= ${OMOBJDIR}/libomapi.a ${DSTOBJDIR}/libdst.a LDADD+=-Wl,-Bstatic .endif LDADD+= -lirs -lisccfg -ldns -lisc -.if !defined(__MINIX) LDADD+=-lpthread -.endif # !defined(__MINIX) .if (${MKCRYPTO} != "no") .if (${MKKERBEROS} != "no") LDADD+= -lgssapi -lkrb5 -lhx509 -lheimntlm -lheimbase \ @@ -71,6 +61,4 @@ LDADD+=-Wl,-Bdynamic DPADD+= ${COBJDIR}/libdhcp.a DPADD+= ${OMOBJDIR}/libomapi.a ${DSTOBJDIR}/libdst.a DPADD+= ${LIBDNS} ${LIBISC} -.if !defined(__MINIX) DPADD+= ${LIBPTHREAD} -.endif # !defined(__MINIX) diff --git a/external/bsd/libevent/include/event2/event-config.h b/external/bsd/libevent/include/event2/event-config.h index 717ca7826..fde5ffdd8 100644 --- a/external/bsd/libevent/include/event2/event-config.h +++ b/external/bsd/libevent/include/event2/event-config.h @@ -21,12 +21,8 @@ /* Define if libevent should not allow replacing the mm functions */ /* #undef _EVENT_DISABLE_MM_REPLACEMENT */ -#if !defined(__minix) /* Define if libevent should not be compiled with thread support */ /* #undef _EVENT_DISABLE_THREAD_SUPPORT */ -#else -#define _EVENT_DISABLE_THREAD_SUPPORT 1 -#endif /* !defined(__minix) */ /* Define to 1 if you have the `arc4random' function. */ #define _EVENT_HAVE_ARC4RANDOM 1 @@ -178,10 +174,8 @@ /* Define if you have POSIX threads libraries and header files. */ /* #undef _EVENT_HAVE_PTHREAD */ -#if !defined(__minix) /* Define if we have pthreads on this system */ #define _EVENT_HAVE_PTHREADS 1 -#endif /* !defined(__minix) */ /* Define to 1 if you have the `putenv' function. */ #define _EVENT_HAVE_PUTENV 1 @@ -425,14 +419,13 @@ /* The size of `off_t', as computed by sizeof. */ #define _EVENT_SIZEOF_OFF_T 8 -#if !defined(__minix) /* The size of `pthread_t', as computed by sizeof. */ #ifdef _LP64 #define _EVENT_SIZEOF_PTHREAD_T 8 #else #define _EVENT_SIZEOF_PTHREAD_T 4 #endif -#endif /* !defined(__minix) */ + /* The size of `short', as computed by sizeof. */ #define _EVENT_SIZEOF_SHORT 2 diff --git a/external/bsd/libevent/lib/Makefile b/external/bsd/libevent/lib/Makefile index 2dfd531be..d24987ee3 100644 --- a/external/bsd/libevent/lib/Makefile +++ b/external/bsd/libevent/lib/Makefile @@ -5,7 +5,6 @@ SUBDIR= libevent .WAIT .if ${MKCRYPTO} != "no" SUBDIR+= libevent_openssl .endif -# MINIX3: insufficient pthreads support in the base system for now -#SUBDIR+= libevent_pthreads +SUBDIR+= libevent_pthreads .include diff --git a/external/bsd/llvm/dist/clang/lib/Driver/Tools.cpp b/external/bsd/llvm/dist/clang/lib/Driver/Tools.cpp index d7b597268..51120db14 100644 --- a/external/bsd/llvm/dist/clang/lib/Driver/Tools.cpp +++ b/external/bsd/llvm/dist/clang/lib/Driver/Tools.cpp @@ -7879,9 +7879,7 @@ void minix::Link::ConstructJob(Compilation &C, const JobAction &JA, if (D.CCCIsCXX()) { getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs); CmdArgs.push_back("-lm"); - - /* LSC: Hack as lc++ is linked against mthread. */ - CmdArgs.push_back("-lmthread"); + CmdArgs.push_back("-lpthread"); } if (Args.hasArg(options::OPT_pthread)) CmdArgs.push_back("-lpthread"); diff --git a/external/bsd/llvm/link.mk b/external/bsd/llvm/link.mk index dd13901e6..1f8c77bb3 100644 --- a/external/bsd/llvm/link.mk +++ b/external/bsd/llvm/link.mk @@ -50,5 +50,5 @@ DPADD+= ${LIBTERMINFO} .if defined(__MINIX) && defined(HOSTPROG) && ${HOST_OSTYPE:C/\-.*//} != "Minix" LDADD+= -lpthread .else -LDADD+= -lc++ -lmthread +LDADD+= -lc++ -lpthread .endif # defined(__MINIX) diff --git a/external/public-domain/sqlite/Makefile.inc b/external/public-domain/sqlite/Makefile.inc index 09616af0a..558f9cd50 100644 --- a/external/public-domain/sqlite/Makefile.inc +++ b/external/public-domain/sqlite/Makefile.inc @@ -23,7 +23,6 @@ CPPFLAGS+= \ .if defined(__MINIX) CPPFLAGS+= \ - -DSQLITE_THREADSAFE=0 \ -DSQLITE_OMIT_WAL .endif # defined(__MINIX) diff --git a/external/public-domain/xz/bin/xz/Makefile b/external/public-domain/xz/bin/xz/Makefile index d1b63df19..2d17ca1a2 100644 --- a/external/public-domain/xz/bin/xz/Makefile +++ b/external/public-domain/xz/bin/xz/Makefile @@ -45,9 +45,7 @@ FILESNAME_${XZSRCDIR}/po/${lang}.gmo= xz.mo .endfor .endif -.if !defined(__MINIX) LDADD+= -lpthread DPADD+= ${LIBPTHREAD} -.endif # !defined(__MINIX) .include diff --git a/external/public-domain/xz/lib/Makefile b/external/public-domain/xz/lib/Makefile index e258f1bdb..3c86288f6 100644 --- a/external/public-domain/xz/lib/Makefile +++ b/external/public-domain/xz/lib/Makefile @@ -33,18 +33,16 @@ SRCS+= tuklib_physmem.c tuklib_cpucores.c SRCS+= check.c crc32_table.c crc64_table.c SRCS+= crc32_fast.c crc64_fast.c -#__MINIX: No pthreads: -# hardware_cputhreads.c outqueue.c stream_encoder_mt.c .PATH: ${XZSRCDIR}/src/liblzma/common SRCS+= common.c block_util.c easy_preset.c filter_common.c \ - hardware_physmem.c index.c \ + hardware_physmem.c hardware_cputhreads.c index.c \ stream_flags_common.c vli_size.c \ alone_encoder.c block_buffer_encoder.c block_encoder.c \ block_header_encoder.c easy_buffer_encoder.c easy_encoder.c \ easy_encoder_memusage.c filter_buffer_encoder.c \ filter_encoder.c filter_flags_encoder.c index_encoder.c \ - stream_buffer_encoder.c stream_encoder.c \ - stream_flags_encoder.c vli_encoder.c \ + stream_buffer_encoder.c stream_encoder.c stream_encoder_mt.c \ + stream_flags_encoder.c vli_encoder.c outqueue.c \ alone_decoder.c auto_decoder.c block_buffer_decoder.c \ block_decoder.c block_header_decoder.c easy_decoder_memusage.c \ filter_buffer_decoder.c filter_decoder.c filter_flags_decoder.c \ @@ -87,9 +85,7 @@ liblzma.pc: ${XZSRCDIR}/src/liblzma/liblzma.pc.in CLEANFILES+= liblzma.pc -.if !defined(__MINIX) LDADD+= -lpthread DPADD+= ${LIBPTHREAD} -.endif # defined(__MINIX) .include diff --git a/lib/Makefile b/lib/Makefile index 7077465e2..654313f18 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -10,12 +10,7 @@ SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgcc .WAIT .endif .if defined(__MINIX) -#LSC MINIX libc depends on -# - libmthread because of sys/lib/libunwind -SUBDIR+= .WAIT - SUBDIR+= ../minix/lib/libsys -SUBDIR+= ../minix/lib/libmthread SUBDIR+= .WAIT .endif # defined(__MINIX) SUBDIR+= libc @@ -35,6 +30,7 @@ SUBDIR+= ../minix/lib/libasyn \ ../minix/lib/liblwip \ ../minix/lib/libminc \ ../minix/lib/libminixfs \ + ../minix/lib/libmthread \ ../minix/lib/libnetdriver \ ../minix/lib/libsffs \ ../minix/lib/libsockdriver \ diff --git a/lib/libc/Makefile.inc b/lib/libc/Makefile.inc index fb28e29d3..5ca650ea5 100644 --- a/lib/libc/Makefile.inc +++ b/lib/libc/Makefile.inc @@ -46,7 +46,7 @@ CPPFLAGS+= -D_LIBC -D_REENTRANT .if defined(MLIBDIR) CPPFLAGS+= -DMLIBDIR=\"${MLIBDIR}\" .endif -.endif # !defined(__minix) +.endif # !defined(__MINIX) .if (${USE_HESIOD} != "no") CPPFLAGS+= -DHESIOD diff --git a/minix/lib/libsys/stacktrace.c b/minix/lib/libsys/stacktrace.c index d7e87eb9c..90778de89 100644 --- a/minix/lib/libsys/stacktrace.c +++ b/minix/lib/libsys/stacktrace.c @@ -8,6 +8,7 @@ Copyright 1995 Philip Homburg #include #include + #include typedef unsigned int reg_t; diff --git a/sys/lib/libunwind/AddressSpace.hpp b/sys/lib/libunwind/AddressSpace.hpp index 327c0d108..278674455 100644 --- a/sys/lib/libunwind/AddressSpace.hpp +++ b/sys/lib/libunwind/AddressSpace.hpp @@ -22,14 +22,7 @@ #include #include #include -#if !defined(__minix) #include -#else -#define pthread_rwlock_init(l, d) /* nothing */ -#define pthread_rwlock_rdlock(l) /* nothing */ -#define pthread_rwlock_wrlock(l) /* nothing */ -#define pthread_rwlock_unlock(l) /* nothing */ -#endif /* !defined(__minix) */ #include "dwarf2.h" @@ -351,9 +344,7 @@ public: private: findPCRange_t findPCRange; bool needsReload; -#if !defined(__minix) pthread_rwlock_t fdeTreeLock; -#endif /* !defined(__minix) */ rb_tree_t segmentTree; rb_tree_t dsoTree; diff --git a/sys/lib/libunwind/UnwindCursor.hpp b/sys/lib/libunwind/UnwindCursor.hpp index 32052f1be..e97964617 100644 --- a/sys/lib/libunwind/UnwindCursor.hpp +++ b/sys/lib/libunwind/UnwindCursor.hpp @@ -14,9 +14,7 @@ #include #include -#if !defined(__minix) #include -#endif /* !defined(__minix) */ #include "AddressSpace.hpp" #include "DwarfInstructions.hpp" diff --git a/tests/lib/libevent/Makefile b/tests/lib/libevent/Makefile index 76eb40c56..039e10e6b 100644 --- a/tests/lib/libevent/Makefile +++ b/tests/lib/libevent/Makefile @@ -13,10 +13,9 @@ BINDIR= ${TESTSDIR} PROG= h_event MAN= # defined -#__MINIX: Not Supported: regress_thread.c SRCS= regress.c regress.gen.c regress_dns.c regress_http.c \ regress_rpc.c regress_main.c tinytest.c regress_testutils.c \ - regress_minheap.c regress_util.c \ + regress_minheap.c regress_util.c regress_thread.c \ regress_buffer.c regress_bufferevent.c regress_listener.c \ regress_zlib.c regress_et.c @@ -26,12 +25,7 @@ DPADD+= ${LIBEVENT_OPENSSL} ${LIBSSL} ${LIBCRYPTO} LDADD+= -levent_openssl -lssl -lcrypto CPPFLAGS+= -DLIBEVENT_CRYPTO .endif -.if !defined(__MINIX) DPADD+= ${LIBEVENT} ${LIBEVENT_PTHREADS} ${LIBZ} ${LIBPTHREAD} LDADD+= -levent_pthreads -levent -lz -lpthread -.else -DPADD+= ${LIBEVENT} ${LIBZ} -LDADD+= -levent -lz -.endif # !defined(__MINIX) .include