From nobody Tue Sep 2 15:23:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cGTzQ1CNRz66sjt; Tue, 02 Sep 2025 15:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cGTzQ0Yb6z3sXc; Tue, 02 Sep 2025 15:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756826626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GcmJ5QzJ3YHUPAK5PDCQmjXxSI0FPjfSL2wRBAjMqoM=; b=GxWHUyoNbLVUvcPPeKjXRXqF1o/r30f0Aop39+RINhb+KmVL6y6QtEaYu76bpHpI7njH7w p2iWz84w6WyJrErRf3/2wSRhtV092kylCcgyeogYTHFUQYeleOugPcTgycfT8Uk+75EmKw Ly5zLGmTgWSsZrw6mmJVwp6FcPCrCG1Ls1WoTNiIdzL5ciJ/cWxNLDs4cQ98OTl7GA6R0S o66Dzh036mUPdniDYm955E/dfuYPBRESUBQPTgXlHDlcRj0fsafJsU68N61k4oxHyUjYUR a6BGmhxxKyBZEryUwJjvw4AZy9VeZlNVExIOG7d7/dbgFj7wrVPDuXDHIU0Q3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756826626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GcmJ5QzJ3YHUPAK5PDCQmjXxSI0FPjfSL2wRBAjMqoM=; b=r8+bYRNtJKuFjX6YnpFo4/qBl6KFJ99jEvrn2FSHMp1HVaJyS5eLxBqiTExL7NuOks7dim GpSPXEqVMY86ljsPWosYzaCNEu7W0LXVAMGpbbMRniJ10I05VKWDpqIQI2mVbCfIIXbsKb JBSJCsgx4uRvQWkErwYV653AbI1WesSWhoLNGVr8AbrVOqYTaFmM+Yhq2LKCi58eF1d2WV s1zM6eT9+lnr2ejms9cH6V0Z+7PiiXfViWJlLOCa+UI2tHcKhBB1Fs44x7SmGDoM0ZWThr sr92VNiBbt5wBPvbzUwWEPtVyx5e5XELGFpBCatRW0ykYmiz61kmWsDJTd4lQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1756826626; a=rsa-sha256; cv=none; b=Cr0+4e62jNwonIyRHMlZjjBlf9Bm5FbQ7NNJMy7v/kXgVJNFBvqtEtL0i4femJ0mopjVw2 XAlk0h+5AeQgIMKz0N6LwTAis3fR07d11I/jGLTmrPmfbSY8GKwwxj65zqVdEZW1qIkBy7 hu7+fkYK/k6hn1OdzY0gVMaF/+G95K8fcdg2MijYQBZXZwzpCr4bEqoPGzCYJEtgAEQWfE JPlpPmNsYSjn/JhOSRB4y/zeHtoxkLewB/gqALnc1F4SARNRKI8OEYX/HwfbDtTiT5qDMl s3ObIJA0p1dsTloQCCgnzGAPzRM9WheONOdAbERRRsdAIkPjvdUslGzCQwzbFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cGTzQ064hzs9h; Tue, 02 Sep 2025 15:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 582FNjco074582; Tue, 2 Sep 2025 15:23:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 582FNjqa074579; Tue, 2 Sep 2025 15:23:45 GMT (envelope-from git) Date: Tue, 2 Sep 2025 15:23:45 GMT Message-Id: <202509021523.582FNjqa074579@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 8ebb3de0c9df - main - jemalloc: Remove bogus merge conflict markers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ebb3de0c9dfb1a15bf24dcb0ca65cc91e7ad0e8 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8ebb3de0c9dfb1a15bf24dcb0ca65cc91e7ad0e8 commit 8ebb3de0c9dfb1a15bf24dcb0ca65cc91e7ad0e8 Author: Warner Losh AuthorDate: 2025-09-02 15:19:28 +0000 Commit: Warner Losh CommitDate: 2025-09-02 15:22:26 +0000 jemalloc: Remove bogus merge conflict markers The merge markers were added, it seems, in one of my rebases. The HEAD entry is the merged code, as far as I can tell, and is what should be in the base. None of these files are used during the build. Noticed by: jhb Sponsored by: Netflix --- contrib/jemalloc/INSTALL.md | 425 -- contrib/jemalloc/Makefile.in | 627 --- contrib/jemalloc/TUNING.md | 133 - contrib/jemalloc/bin/jeprof.in | 5629 -------------------- contrib/jemalloc/build-aux/config.guess | 1466 ----- contrib/jemalloc/build-aux/config.sub | 1829 ------- contrib/jemalloc/configure.ac | 2410 --------- contrib/jemalloc/doc/jemalloc.xml.in | 3542 ------------ .../jemalloc/internal/jemalloc_internal_defs.h.in | 370 -- .../jemalloc/internal/jemalloc_preamble.h.in | 216 - .../jemalloc/include/jemalloc/internal/tsd_win.h | 143 - .../jemalloc/include/jemalloc/jemalloc_defs.h.in | 52 - .../jemalloc/include/jemalloc/jemalloc_macros.h.in | 133 - .../jemalloc/include/jemalloc/jemalloc_protos.h.in | 70 - contrib/jemalloc/m4/ax_cxx_compile_stdcxx.m4 | 566 -- contrib/jemalloc/scripts/gen_run_tests.py | 130 - contrib/jemalloc/scripts/gen_travis.py | 153 - contrib/jemalloc/src/jemalloc_cpp.cpp | 145 - 18 files changed, 18039 deletions(-) diff --git a/contrib/jemalloc/INSTALL.md b/contrib/jemalloc/INSTALL.md index 9701364041c8..90da718d2b6a 100644 --- a/contrib/jemalloc/INSTALL.md +++ b/contrib/jemalloc/INSTALL.md @@ -1,4 +1,3 @@ -<<<<<<< HEAD Building and installing a packaged release of jemalloc can be as simple as typing the following while in the root directory of the source tree: @@ -423,427 +422,3 @@ can be used to view the html manual. The roff manual page can be formatted prior to installation via the following command: nroff -man -t doc/jemalloc.3 -||||||| dec341af7695 -======= -Building and installing a packaged release of jemalloc can be as simple as -typing the following while in the root directory of the source tree: - - ./configure - make - make install - -If building from unpackaged developer sources, the simplest command sequence -that might work is: - - ./autogen.sh - make dist - make - make install - -Note that documentation is not built by the default target because doing so -would create a dependency on xsltproc in packaged releases, hence the -requirement to either run 'make dist' or avoid installing docs via the various -install_* targets documented below. - - -## Advanced configuration - -The 'configure' script supports numerous options that allow control of which -functionality is enabled, where jemalloc is installed, etc. Optionally, pass -any of the following arguments (not a definitive list) to 'configure': - -* `--help` - - Print a definitive list of options. - -* `--prefix=` - - Set the base directory in which to install. For example: - - ./configure --prefix=/usr/local - - will cause files to be installed into /usr/local/include, /usr/local/lib, - and /usr/local/man. - -* `--with-version=(..--g|VERSION)` - - The VERSION file is mandatory for successful configuration, and the - following steps are taken to assure its presence: - 1) If --with-version=..--g is specified, - generate VERSION using the specified value. - 2) If --with-version is not specified in either form and the source - directory is inside a git repository, try to generate VERSION via 'git - describe' invocations that pattern-match release tags. - 3) If VERSION is missing, generate it with a bogus version: - 0.0.0-0-g0000000000000000000000000000000000000000 - - Note that --with-version=VERSION bypasses (1) and (2), which simplifies - VERSION configuration when embedding a jemalloc release into another - project's git repository. - -* `--with-rpath=` - - Embed one or more library paths, so that libjemalloc can find the libraries - it is linked to. This works only on ELF-based systems. - -* `--with-mangling=` - - Mangle public symbols specified in which is a comma-separated list of - name:mangled pairs. - - For example, to use ld's --wrap option as an alternative method for - overriding libc's malloc implementation, specify something like: - - --with-mangling=malloc:__wrap_malloc,free:__wrap_free[...] - - Note that mangling happens prior to application of the prefix specified by - --with-jemalloc-prefix, and mangled symbols are then ignored when applying - the prefix. - -* `--with-jemalloc-prefix=` - - Prefix all public APIs with . For example, if is - "prefix_", API changes like the following occur: - - malloc() --> prefix_malloc() - malloc_conf --> prefix_malloc_conf - /etc/malloc.conf --> /etc/prefix_malloc.conf - MALLOC_CONF --> PREFIX_MALLOC_CONF - - This makes it possible to use jemalloc at the same time as the system - allocator, or even to use multiple copies of jemalloc simultaneously. - - By default, the prefix is "", except on OS X, where it is "je_". On OS X, - jemalloc overlays the default malloc zone, but makes no attempt to actually - replace the "malloc", "calloc", etc. symbols. - -* `--without-export` - - Don't export public APIs. This can be useful when building jemalloc as a - static library, or to avoid exporting public APIs when using the zone - allocator on OSX. - -* `--with-private-namespace=` - - Prefix all library-private APIs with je_. For shared libraries, - symbol visibility mechanisms prevent these symbols from being exported, but - for static libraries, naming collisions are a real possibility. By - default, is empty, which results in a symbol prefix of je_ . - -* `--with-install-suffix=` - - Append to the base name of all installed files, such that multiple - versions of jemalloc can coexist in the same installation directory. For - example, libjemalloc.so.0 becomes libjemalloc.so.0. - -* `--with-malloc-conf=` - - Embed `` as a run-time options string that is processed prior to - the malloc_conf global variable, the /etc/malloc.conf symlink, and the - MALLOC_CONF environment variable. For example, to change the default decay - time to 30 seconds: - - --with-malloc-conf=decay_ms:30000 - -* `--enable-debug` - - Enable assertions and validation code. This incurs a substantial - performance hit, but is very useful during application development. - -* `--disable-stats` - - Disable statistics gathering functionality. See the "opt.stats_print" - option documentation for usage details. - -* `--enable-prof` - - Enable heap profiling and leak detection functionality. See the "opt.prof" - option documentation for usage details. When enabled, there are several - approaches to backtracing, and the configure script chooses the first one - in the following list that appears to function correctly: - - + libunwind (requires --enable-prof-libunwind) - + libgcc (unless --disable-prof-libgcc) - + gcc intrinsics (unless --disable-prof-gcc) - -* `--enable-prof-libunwind` - - Use the libunwind library (http://www.nongnu.org/libunwind/) for stack - backtracing. - -* `--disable-prof-libgcc` - - Disable the use of libgcc's backtracing functionality. - -* `--disable-prof-gcc` - - Disable the use of gcc intrinsics for backtracing. - -* `--with-static-libunwind=` - - Statically link against the specified libunwind.a rather than dynamically - linking with -lunwind. - -* `--disable-fill` - - Disable support for junk/zero filling of memory. See the "opt.junk" and - "opt.zero" option documentation for usage details. - -* `--disable-zone-allocator` - - Disable zone allocator for Darwin. This means jemalloc won't be hooked as - the default allocator on OSX/iOS. - -* `--enable-utrace` - - Enable utrace(2)-based allocation tracing. This feature is not broadly - portable (FreeBSD has it, but Linux and OS X do not). - -* `--enable-xmalloc` - - Enable support for optional immediate termination due to out-of-memory - errors, as is commonly implemented by "xmalloc" wrapper function for malloc. - See the "opt.xmalloc" option documentation for usage details. - -* `--enable-lazy-lock` - - Enable code that wraps pthread_create() to detect when an application - switches from single-threaded to multi-threaded mode, so that it can avoid - mutex locking/unlocking operations while in single-threaded mode. In - practice, this feature usually has little impact on performance unless - thread-specific caching is disabled. - -* `--disable-cache-oblivious` - - Disable cache-oblivious large allocation alignment for large allocation - requests with no alignment constraints. If this feature is disabled, all - large allocations are page-aligned as an implementation artifact, which can - severely harm CPU cache utilization. However, the cache-oblivious layout - comes at the cost of one extra page per large allocation, which in the - most extreme case increases physical memory usage for the 16 KiB size class - to 20 KiB. - -* `--disable-syscall` - - Disable use of syscall(2) rather than {open,read,write,close}(2). This is - intended as a workaround for systems that place security limitations on - syscall(2). - -* `--disable-cxx` - - Disable C++ integration. This will cause new and delete operator - implementations to be omitted. - -* `--with-xslroot=` - - Specify where to find DocBook XSL stylesheets when building the - documentation. - -* `--with-lg-page=` - - Specify the base 2 log of the allocator page size, which must in turn be at - least as large as the system page size. By default the configure script - determines the host's page size and sets the allocator page size equal to - the system page size, so this option need not be specified unless the - system page size may change between configuration and execution, e.g. when - cross compiling. - -* `--with-lg-hugepage=` - - Specify the base 2 log of the system huge page size. This option is useful - when cross compiling, or when overriding the default for systems that do - not explicitly support huge pages. - -* `--with-lg-quantum=` - - Specify the base 2 log of the minimum allocation alignment. jemalloc needs - to know the minimum alignment that meets the following C standard - requirement (quoted from the April 12, 2011 draft of the C11 standard): - - > The pointer returned if the allocation succeeds is suitably aligned so - that it may be assigned to a pointer to any type of object with a - fundamental alignment requirement and then used to access such an object - or an array of such objects in the space allocated [...] - - This setting is architecture-specific, and although jemalloc includes known - safe values for the most commonly used modern architectures, there is a - wrinkle related to GNU libc (glibc) that may impact your choice of - . On most modern architectures, this mandates 16-byte - alignment (=4), but the glibc developers chose not to meet this - requirement for performance reasons. An old discussion can be found at - . Unlike glibc, - jemalloc does follow the C standard by default (caveat: jemalloc - technically cheats for size classes smaller than the quantum), but the fact - that Linux systems already work around this allocator noncompliance means - that it is generally safe in practice to let jemalloc's minimum alignment - follow glibc's lead. If you specify `--with-lg-quantum=3` during - configuration, jemalloc will provide additional size classes that are not - 16-byte-aligned (24, 40, and 56). - -* `--with-lg-vaddr=` - - Specify the number of significant virtual address bits. By default, the - configure script attempts to detect virtual address size on those platforms - where it knows how, and picks a default otherwise. This option may be - useful when cross-compiling. - -* `--disable-initial-exec-tls` - - Disable the initial-exec TLS model for jemalloc's internal thread-local - storage (on those platforms that support explicit settings). This can allow - jemalloc to be dynamically loaded after program startup (e.g. using dlopen). - Note that in this case, there will be two malloc implementations operating - in the same process, which will almost certainly result in confusing runtime - crashes if pointers leak from one implementation to the other. - -* `--disable-libdl` - - Disable the usage of libdl, namely dlsym(3) which is required by the lazy - lock option. This can allow building static binaries. - -The following environment variables (not a definitive list) impact configure's -behavior: - -* `CFLAGS="?"` -* `CXXFLAGS="?"` - - Pass these flags to the C/C++ compiler. Any flags set by the configure - script are prepended, which means explicitly set flags generally take - precedence. Take care when specifying flags such as -Werror, because - configure tests may be affected in undesirable ways. - -* `EXTRA_CFLAGS="?"` -* `EXTRA_CXXFLAGS="?"` - - Append these flags to CFLAGS/CXXFLAGS, without passing them to the - compiler(s) during configuration. This makes it possible to add flags such - as -Werror, while allowing the configure script to determine what other - flags are appropriate for the specified configuration. - -* `CPPFLAGS="?"` - - Pass these flags to the C preprocessor. Note that CFLAGS is not passed to - 'cpp' when 'configure' is looking for include files, so you must use - CPPFLAGS instead if you need to help 'configure' find header files. - -* `LD_LIBRARY_PATH="?"` - - 'ld' uses this colon-separated list to find libraries. - -* `LDFLAGS="?"` - - Pass these flags when linking. - -* `PATH="?"` - - 'configure' uses this to find programs. - -In some cases it may be necessary to work around configuration results that do -not match reality. For example, Linux 4.5 added support for the MADV_FREE flag -to madvise(2), which can cause problems if building on a host with MADV_FREE -support and deploying to a target without. To work around this, use a cache -file to override the relevant configuration variable defined in configure.ac, -e.g.: - - echo "je_cv_madv_free=no" > config.cache && ./configure -C - - -## Advanced compilation - -To build only parts of jemalloc, use the following targets: - - build_lib_shared - build_lib_static - build_lib - build_doc_html - build_doc_man - build_doc - -To install only parts of jemalloc, use the following targets: - - install_bin - install_include - install_lib_shared - install_lib_static - install_lib_pc - install_lib - install_doc_html - install_doc_man - install_doc - -To clean up build results to varying degrees, use the following make targets: - - clean - distclean - relclean - - -## Advanced installation - -Optionally, define make variables when invoking make, including (not -exclusively): - -* `INCLUDEDIR="?"` - - Use this as the installation prefix for header files. - -* `LIBDIR="?"` - - Use this as the installation prefix for libraries. - -* `MANDIR="?"` - - Use this as the installation prefix for man pages. - -* `DESTDIR="?"` - - Prepend DESTDIR to INCLUDEDIR, LIBDIR, DATADIR, and MANDIR. This is useful - when installing to a different path than was specified via --prefix. - -* `CC="?"` - - Use this to invoke the C compiler. - -* `CFLAGS="?"` - - Pass these flags to the compiler. - -* `CPPFLAGS="?"` - - Pass these flags to the C preprocessor. - -* `LDFLAGS="?"` - - Pass these flags when linking. - -* `PATH="?"` - - Use this to search for programs used during configuration and building. - - -## Development - -If you intend to make non-trivial changes to jemalloc, use the 'autogen.sh' -script rather than 'configure'. This re-generates 'configure', enables -configuration dependency rules, and enables re-generation of automatically -generated source files. - -The build system supports using an object directory separate from the source -tree. For example, you can create an 'obj' directory, and from within that -directory, issue configuration and build commands: - - autoconf - mkdir obj - cd obj - ../configure --enable-autogen - make - - -## Documentation - -The manual page is generated in both html and roff formats. Any web browser -can be used to view the html manual. The roff manual page can be formatted -prior to installation via the following command: - - nroff -man -t doc/jemalloc.3 ->>>>>>> main diff --git a/contrib/jemalloc/Makefile.in b/contrib/jemalloc/Makefile.in index 121297702bcc..1193cd859c49 100644 --- a/contrib/jemalloc/Makefile.in +++ b/contrib/jemalloc/Makefile.in @@ -1,4 +1,3 @@ -<<<<<<< HEAD # Clear out all vpaths, then set just one (default vpath) for the main build # directory. vpath @@ -761,629 +760,3 @@ $(objroot)config.stamp : $(cfgoutputs_in) $(cfghdrs_in) $(srcroot)configure $(cfgoutputs_out) $(cfghdrs_out) : $(objroot)config.stamp @true endif -||||||| dec341af7695 -======= -# Clear out all vpaths, then set just one (default vpath) for the main build -# directory. -vpath -vpath % . - -# Clear the default suffixes, so that built-in rules are not used. -.SUFFIXES : - -SHELL := /bin/sh - -CC := @CC@ -CXX := @CXX@ - -# Configuration parameters. -DESTDIR = -BINDIR := $(DESTDIR)@BINDIR@ -INCLUDEDIR := $(DESTDIR)@INCLUDEDIR@ -LIBDIR := $(DESTDIR)@LIBDIR@ -DATADIR := $(DESTDIR)@DATADIR@ -MANDIR := $(DESTDIR)@MANDIR@ -srcroot := @srcroot@ -objroot := @objroot@ -abs_srcroot := @abs_srcroot@ -abs_objroot := @abs_objroot@ - -# Build parameters. -CPPFLAGS := @CPPFLAGS@ -I$(objroot)include -I$(srcroot)include -CONFIGURE_CFLAGS := @CONFIGURE_CFLAGS@ -SPECIFIED_CFLAGS := @SPECIFIED_CFLAGS@ -EXTRA_CFLAGS := @EXTRA_CFLAGS@ -CFLAGS := $(strip $(CONFIGURE_CFLAGS) $(SPECIFIED_CFLAGS) $(EXTRA_CFLAGS)) -CONFIGURE_CXXFLAGS := @CONFIGURE_CXXFLAGS@ -SPECIFIED_CXXFLAGS := @SPECIFIED_CXXFLAGS@ -EXTRA_CXXFLAGS := @EXTRA_CXXFLAGS@ -CXXFLAGS := $(strip $(CONFIGURE_CXXFLAGS) $(SPECIFIED_CXXFLAGS) $(EXTRA_CXXFLAGS)) -LDFLAGS := @LDFLAGS@ -EXTRA_LDFLAGS := @EXTRA_LDFLAGS@ -LIBS := @LIBS@ -RPATH_EXTRA := @RPATH_EXTRA@ -SO := @so@ -IMPORTLIB := @importlib@ -O := @o@ -A := @a@ -EXE := @exe@ -LIBPREFIX := @libprefix@ -REV := @rev@ -install_suffix := @install_suffix@ -ABI := @abi@ -XSLTPROC := @XSLTPROC@ -XSLROOT := @XSLROOT@ -AUTOCONF := @AUTOCONF@ -_RPATH = @RPATH@ -RPATH = $(if $(1),$(call _RPATH,$(1))) -cfghdrs_in := $(addprefix $(srcroot),@cfghdrs_in@) -cfghdrs_out := @cfghdrs_out@ -cfgoutputs_in := $(addprefix $(srcroot),@cfgoutputs_in@) -cfgoutputs_out := @cfgoutputs_out@ -enable_autogen := @enable_autogen@ -enable_doc := @enable_doc@ -enable_shared := @enable_shared@ -enable_static := @enable_static@ -enable_prof := @enable_prof@ -enable_zone_allocator := @enable_zone_allocator@ -enable_experimental_smallocx := @enable_experimental_smallocx@ -MALLOC_CONF := @JEMALLOC_CPREFIX@MALLOC_CONF -link_whole_archive := @link_whole_archive@ -DSO_LDFLAGS = @DSO_LDFLAGS@ -SOREV = @SOREV@ -PIC_CFLAGS = @PIC_CFLAGS@ -CTARGET = @CTARGET@ -LDTARGET = @LDTARGET@ -TEST_LD_MODE = @TEST_LD_MODE@ -MKLIB = @MKLIB@ -AR = @AR@ -ARFLAGS = @ARFLAGS@ -DUMP_SYMS = @DUMP_SYMS@ -AWK := @AWK@ -CC_MM = @CC_MM@ -LM := @LM@ -INSTALL = @INSTALL@ - -ifeq (macho, $(ABI)) -TEST_LIBRARY_PATH := DYLD_FALLBACK_LIBRARY_PATH="$(objroot)lib" -else -ifeq (pecoff, $(ABI)) -TEST_LIBRARY_PATH := PATH="$(PATH):$(objroot)lib" -else -TEST_LIBRARY_PATH := -endif -endif - -LIBJEMALLOC := $(LIBPREFIX)jemalloc$(install_suffix) - -# Lists of files. -BINS := $(objroot)bin/jemalloc-config $(objroot)bin/jemalloc.sh $(objroot)bin/jeprof -C_HDRS := $(objroot)include/jemalloc/jemalloc$(install_suffix).h -C_SRCS := $(srcroot)src/jemalloc.c \ - $(srcroot)src/arena.c \ - $(srcroot)src/background_thread.c \ - $(srcroot)src/base.c \ - $(srcroot)src/bin.c \ - $(srcroot)src/bitmap.c \ - $(srcroot)src/ckh.c \ - $(srcroot)src/ctl.c \ - $(srcroot)src/div.c \ - $(srcroot)src/extent.c \ - $(srcroot)src/extent_dss.c \ - $(srcroot)src/extent_mmap.c \ - $(srcroot)src/hash.c \ - $(srcroot)src/hook.c \ - $(srcroot)src/large.c \ - $(srcroot)src/log.c \ - $(srcroot)src/malloc_io.c \ - $(srcroot)src/mutex.c \ - $(srcroot)src/mutex_pool.c \ - $(srcroot)src/nstime.c \ - $(srcroot)src/pages.c \ - $(srcroot)src/prng.c \ - $(srcroot)src/prof.c \ - $(srcroot)src/rtree.c \ - $(srcroot)src/safety_check.c \ - $(srcroot)src/stats.c \ - $(srcroot)src/sc.c \ - $(srcroot)src/sz.c \ - $(srcroot)src/tcache.c \ - $(srcroot)src/test_hooks.c \ - $(srcroot)src/ticker.c \ - $(srcroot)src/tsd.c \ - $(srcroot)src/witness.c -ifeq ($(enable_zone_allocator), 1) -C_SRCS += $(srcroot)src/zone.c -endif -ifeq ($(IMPORTLIB),$(SO)) -STATIC_LIBS := $(objroot)lib/$(LIBJEMALLOC).$(A) -endif -ifdef PIC_CFLAGS -STATIC_LIBS += $(objroot)lib/$(LIBJEMALLOC)_pic.$(A) -else -STATIC_LIBS += $(objroot)lib/$(LIBJEMALLOC)_s.$(A) -endif -DSOS := $(objroot)lib/$(LIBJEMALLOC).$(SOREV) -ifneq ($(SOREV),$(SO)) -DSOS += $(objroot)lib/$(LIBJEMALLOC).$(SO) -endif -ifeq (1, $(link_whole_archive)) -LJEMALLOC := -Wl,--whole-archive -L$(objroot)lib -l$(LIBJEMALLOC) -Wl,--no-whole-archive -else -LJEMALLOC := $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB) -endif -PC := $(objroot)jemalloc.pc -MAN3 := $(objroot)doc/jemalloc$(install_suffix).3 -DOCS_XML := $(objroot)doc/jemalloc$(install_suffix).xml -DOCS_HTML := $(DOCS_XML:$(objroot)%.xml=$(objroot)%.html) -DOCS_MAN3 := $(DOCS_XML:$(objroot)%.xml=$(objroot)%.3) -DOCS := $(DOCS_HTML) $(DOCS_MAN3) -C_TESTLIB_SRCS := $(srcroot)test/src/btalloc.c $(srcroot)test/src/btalloc_0.c \ - $(srcroot)test/src/btalloc_1.c $(srcroot)test/src/math.c \ - $(srcroot)test/src/mtx.c $(srcroot)test/src/mq.c \ - $(srcroot)test/src/SFMT.c $(srcroot)test/src/test.c \ - $(srcroot)test/src/thd.c $(srcroot)test/src/timer.c -ifeq (1, $(link_whole_archive)) -C_UTIL_INTEGRATION_SRCS := -C_UTIL_CPP_SRCS := -else -C_UTIL_INTEGRATION_SRCS := $(srcroot)src/nstime.c $(srcroot)src/malloc_io.c -C_UTIL_CPP_SRCS := $(srcroot)src/nstime.c $(srcroot)src/malloc_io.c -endif -TESTS_UNIT := \ - $(srcroot)test/unit/a0.c \ - $(srcroot)test/unit/arena_reset.c \ - $(srcroot)test/unit/atomic.c \ - $(srcroot)test/unit/background_thread.c \ - $(srcroot)test/unit/background_thread_enable.c \ - $(srcroot)test/unit/base.c \ - $(srcroot)test/unit/bitmap.c \ - $(srcroot)test/unit/bit_util.c \ - $(srcroot)test/unit/binshard.c \ - $(srcroot)test/unit/ckh.c \ - $(srcroot)test/unit/decay.c \ - $(srcroot)test/unit/div.c \ - $(srcroot)test/unit/emitter.c \ - $(srcroot)test/unit/extent_quantize.c \ - $(srcroot)test/unit/extent_util.c \ - $(srcroot)test/unit/fork.c \ - $(srcroot)test/unit/hash.c \ - $(srcroot)test/unit/hook.c \ - $(srcroot)test/unit/huge.c \ - $(srcroot)test/unit/junk.c \ - $(srcroot)test/unit/junk_alloc.c \ - $(srcroot)test/unit/junk_free.c \ - $(srcroot)test/unit/log.c \ - $(srcroot)test/unit/mallctl.c \ - $(srcroot)test/unit/malloc_io.c \ - $(srcroot)test/unit/math.c \ - $(srcroot)test/unit/mq.c \ - $(srcroot)test/unit/mtx.c \ - $(srcroot)test/unit/pack.c \ - $(srcroot)test/unit/pages.c \ - $(srcroot)test/unit/ph.c \ - $(srcroot)test/unit/prng.c \ - $(srcroot)test/unit/prof_accum.c \ - $(srcroot)test/unit/prof_active.c \ - $(srcroot)test/unit/prof_gdump.c \ - $(srcroot)test/unit/prof_idump.c \ - $(srcroot)test/unit/prof_log.c \ - $(srcroot)test/unit/prof_reset.c \ - $(srcroot)test/unit/prof_tctx.c \ - $(srcroot)test/unit/prof_thread_name.c \ - $(srcroot)test/unit/ql.c \ - $(srcroot)test/unit/qr.c \ - $(srcroot)test/unit/rb.c \ - $(srcroot)test/unit/retained.c \ - $(srcroot)test/unit/rtree.c \ - $(srcroot)test/unit/safety_check.c \ - $(srcroot)test/unit/seq.c \ - $(srcroot)test/unit/SFMT.c \ - $(srcroot)test/unit/sc.c \ - $(srcroot)test/unit/size_classes.c \ - $(srcroot)test/unit/slab.c \ - $(srcroot)test/unit/smoothstep.c \ - $(srcroot)test/unit/spin.c \ - $(srcroot)test/unit/stats.c \ - $(srcroot)test/unit/stats_print.c \ - $(srcroot)test/unit/test_hooks.c \ - $(srcroot)test/unit/ticker.c \ - $(srcroot)test/unit/nstime.c \ - $(srcroot)test/unit/tsd.c \ - $(srcroot)test/unit/witness.c \ - $(srcroot)test/unit/zero.c -ifeq (@enable_prof@, 1) -TESTS_UNIT += \ - $(srcroot)test/unit/arena_reset_prof.c -endif -TESTS_INTEGRATION := $(srcroot)test/integration/aligned_alloc.c \ - $(srcroot)test/integration/allocated.c \ - $(srcroot)test/integration/extent.c \ - $(srcroot)test/integration/malloc.c \ - $(srcroot)test/integration/mallocx.c \ - $(srcroot)test/integration/MALLOCX_ARENA.c \ - $(srcroot)test/integration/overflow.c \ - $(srcroot)test/integration/posix_memalign.c \ - $(srcroot)test/integration/rallocx.c \ - $(srcroot)test/integration/sdallocx.c \ - $(srcroot)test/integration/slab_sizes.c \ - $(srcroot)test/integration/thread_arena.c \ - $(srcroot)test/integration/thread_tcache_enabled.c \ - $(srcroot)test/integration/xallocx.c -ifeq (@enable_experimental_smallocx@, 1) -TESTS_INTEGRATION += \ - $(srcroot)test/integration/smallocx.c -endif -ifeq (@enable_cxx@, 1) -CPP_SRCS := $(srcroot)src/jemalloc_cpp.cpp -TESTS_INTEGRATION_CPP := $(srcroot)test/integration/cpp/basic.cpp -else -CPP_SRCS := -TESTS_INTEGRATION_CPP := -endif -TESTS_STRESS := $(srcroot)test/stress/microbench.c \ - $(srcroot)test/stress/hookbench.c - - -TESTS := $(TESTS_UNIT) $(TESTS_INTEGRATION) $(TESTS_INTEGRATION_CPP) $(TESTS_STRESS) - -PRIVATE_NAMESPACE_HDRS := $(objroot)include/jemalloc/internal/private_namespace.h $(objroot)include/jemalloc/internal/private_namespace_jet.h -PRIVATE_NAMESPACE_GEN_HDRS := $(PRIVATE_NAMESPACE_HDRS:%.h=%.gen.h) -C_SYM_OBJS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.sym.$(O)) -C_SYMS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.sym) -C_OBJS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.$(O)) -CPP_OBJS := $(CPP_SRCS:$(srcroot)%.cpp=$(objroot)%.$(O)) -C_PIC_OBJS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.pic.$(O)) -CPP_PIC_OBJS := $(CPP_SRCS:$(srcroot)%.cpp=$(objroot)%.pic.$(O)) -C_JET_SYM_OBJS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.jet.sym.$(O)) -C_JET_SYMS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.jet.sym) -C_JET_OBJS := $(C_SRCS:$(srcroot)%.c=$(objroot)%.jet.$(O)) -C_TESTLIB_UNIT_OBJS := $(C_TESTLIB_SRCS:$(srcroot)%.c=$(objroot)%.unit.$(O)) -C_TESTLIB_INTEGRATION_OBJS := $(C_TESTLIB_SRCS:$(srcroot)%.c=$(objroot)%.integration.$(O)) -C_UTIL_INTEGRATION_OBJS := $(C_UTIL_INTEGRATION_SRCS:$(srcroot)%.c=$(objroot)%.integration.$(O)) -C_TESTLIB_STRESS_OBJS := $(C_TESTLIB_SRCS:$(srcroot)%.c=$(objroot)%.stress.$(O)) -C_TESTLIB_OBJS := $(C_TESTLIB_UNIT_OBJS) $(C_TESTLIB_INTEGRATION_OBJS) $(C_UTIL_INTEGRATION_OBJS) $(C_TESTLIB_STRESS_OBJS) - -TESTS_UNIT_OBJS := $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%.$(O)) -TESTS_INTEGRATION_OBJS := $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%.$(O)) -TESTS_INTEGRATION_CPP_OBJS := $(TESTS_INTEGRATION_CPP:$(srcroot)%.cpp=$(objroot)%.$(O)) -TESTS_STRESS_OBJS := $(TESTS_STRESS:$(srcroot)%.c=$(objroot)%.$(O)) -TESTS_OBJS := $(TESTS_UNIT_OBJS) $(TESTS_INTEGRATION_OBJS) $(TESTS_STRESS_OBJS) -TESTS_CPP_OBJS := $(TESTS_INTEGRATION_CPP_OBJS) - -.PHONY: all dist build_doc_html build_doc_man build_doc -.PHONY: install_bin install_include install_lib -.PHONY: install_doc_html install_doc_man install_doc install -.PHONY: tests check clean distclean relclean - -.SECONDARY : $(PRIVATE_NAMESPACE_GEN_HDRS) $(TESTS_OBJS) $(TESTS_CPP_OBJS) - -# Default target. -all: build_lib - -dist: build_doc - -$(objroot)doc/%.html : $(objroot)doc/%.xml $(srcroot)doc/stylesheet.xsl $(objroot)doc/html.xsl -ifneq ($(XSLROOT),) - $(XSLTPROC) -o $@ $(objroot)doc/html.xsl $< -else -ifeq ($(wildcard $(DOCS_HTML)),) - @echo "

Missing xsltproc. Doc not built.

" > $@ -endif - @echo "Missing xsltproc. "$@" not (re)built." -endif - -$(objroot)doc/%.3 : $(objroot)doc/%.xml $(srcroot)doc/stylesheet.xsl $(objroot)doc/manpages.xsl -ifneq ($(XSLROOT),) - $(XSLTPROC) -o $@ $(objroot)doc/manpages.xsl $< -else -ifeq ($(wildcard $(DOCS_MAN3)),) - @echo "Missing xsltproc. Doc not built." > $@ -endif - @echo "Missing xsltproc. "$@" not (re)built." -endif - -build_doc_html: $(DOCS_HTML) -build_doc_man: $(DOCS_MAN3) -build_doc: $(DOCS) - -# -# Include generated dependency files. -# -ifdef CC_MM --include $(C_SYM_OBJS:%.$(O)=%.d) --include $(C_OBJS:%.$(O)=%.d) --include $(CPP_OBJS:%.$(O)=%.d) --include $(C_PIC_OBJS:%.$(O)=%.d) --include $(CPP_PIC_OBJS:%.$(O)=%.d) --include $(C_JET_SYM_OBJS:%.$(O)=%.d) --include $(C_JET_OBJS:%.$(O)=%.d) --include $(C_TESTLIB_OBJS:%.$(O)=%.d) --include $(TESTS_OBJS:%.$(O)=%.d) --include $(TESTS_CPP_OBJS:%.$(O)=%.d) -endif - -$(C_SYM_OBJS): $(objroot)src/%.sym.$(O): $(srcroot)src/%.c -$(C_SYM_OBJS): CPPFLAGS += -DJEMALLOC_NO_PRIVATE_NAMESPACE -$(C_SYMS): $(objroot)src/%.sym: $(objroot)src/%.sym.$(O) -$(C_OBJS): $(objroot)src/%.$(O): $(srcroot)src/%.c -$(CPP_OBJS): $(objroot)src/%.$(O): $(srcroot)src/%.cpp -$(C_PIC_OBJS): $(objroot)src/%.pic.$(O): $(srcroot)src/%.c -$(C_PIC_OBJS): CFLAGS += $(PIC_CFLAGS) -$(CPP_PIC_OBJS): $(objroot)src/%.pic.$(O): $(srcroot)src/%.cpp -$(CPP_PIC_OBJS): CXXFLAGS += $(PIC_CFLAGS) -$(C_JET_SYM_OBJS): $(objroot)src/%.jet.sym.$(O): $(srcroot)src/%.c -$(C_JET_SYM_OBJS): CPPFLAGS += -DJEMALLOC_JET -DJEMALLOC_NO_PRIVATE_NAMESPACE -$(C_JET_SYMS): $(objroot)src/%.jet.sym: $(objroot)src/%.jet.sym.$(O) -$(C_JET_OBJS): $(objroot)src/%.jet.$(O): $(srcroot)src/%.c -$(C_JET_OBJS): CPPFLAGS += -DJEMALLOC_JET -$(C_TESTLIB_UNIT_OBJS): $(objroot)test/src/%.unit.$(O): $(srcroot)test/src/%.c -$(C_TESTLIB_UNIT_OBJS): CPPFLAGS += -DJEMALLOC_UNIT_TEST -$(C_TESTLIB_INTEGRATION_OBJS): $(objroot)test/src/%.integration.$(O): $(srcroot)test/src/%.c -$(C_TESTLIB_INTEGRATION_OBJS): CPPFLAGS += -DJEMALLOC_INTEGRATION_TEST -$(C_UTIL_INTEGRATION_OBJS): $(objroot)src/%.integration.$(O): $(srcroot)src/%.c -$(C_TESTLIB_STRESS_OBJS): $(objroot)test/src/%.stress.$(O): $(srcroot)test/src/%.c -$(C_TESTLIB_STRESS_OBJS): CPPFLAGS += -DJEMALLOC_STRESS_TEST -DJEMALLOC_STRESS_TESTLIB -$(C_TESTLIB_OBJS): CPPFLAGS += -I$(srcroot)test/include -I$(objroot)test/include -$(TESTS_UNIT_OBJS): CPPFLAGS += -DJEMALLOC_UNIT_TEST -$(TESTS_INTEGRATION_OBJS): CPPFLAGS += -DJEMALLOC_INTEGRATION_TEST -$(TESTS_INTEGRATION_CPP_OBJS): CPPFLAGS += -DJEMALLOC_INTEGRATION_CPP_TEST -$(TESTS_STRESS_OBJS): CPPFLAGS += -DJEMALLOC_STRESS_TEST -$(TESTS_OBJS): $(objroot)test/%.$(O): $(srcroot)test/%.c -$(TESTS_CPP_OBJS): $(objroot)test/%.$(O): $(srcroot)test/%.cpp -$(TESTS_OBJS): CPPFLAGS += -I$(srcroot)test/include -I$(objroot)test/include -$(TESTS_CPP_OBJS): CPPFLAGS += -I$(srcroot)test/include -I$(objroot)test/include -ifneq ($(IMPORTLIB),$(SO)) -$(CPP_OBJS) $(C_SYM_OBJS) $(C_OBJS) $(C_JET_SYM_OBJS) $(C_JET_OBJS): CPPFLAGS += -DDLLEXPORT -endif - -# Dependencies. -ifndef CC_MM -HEADER_DIRS = $(srcroot)include/jemalloc/internal \ - $(objroot)include/jemalloc $(objroot)include/jemalloc/internal -HEADERS = $(filter-out $(PRIVATE_NAMESPACE_HDRS),$(wildcard $(foreach dir,$(HEADER_DIRS),$(dir)/*.h))) -$(C_SYM_OBJS) $(C_OBJS) $(CPP_OBJS) $(C_PIC_OBJS) $(CPP_PIC_OBJS) $(C_JET_SYM_OBJS) $(C_JET_OBJS) $(C_TESTLIB_OBJS) $(TESTS_OBJS) $(TESTS_CPP_OBJS): $(HEADERS) -$(TESTS_OBJS) $(TESTS_CPP_OBJS): $(objroot)test/include/test/jemalloc_test.h -endif - -$(C_OBJS) $(CPP_OBJS) $(C_PIC_OBJS) $(CPP_PIC_OBJS) $(C_TESTLIB_INTEGRATION_OBJS) $(C_UTIL_INTEGRATION_OBJS) $(TESTS_INTEGRATION_OBJS) $(TESTS_INTEGRATION_CPP_OBJS): $(objroot)include/jemalloc/internal/private_namespace.h -$(C_JET_OBJS) $(C_TESTLIB_UNIT_OBJS) $(C_TESTLIB_STRESS_OBJS) $(TESTS_UNIT_OBJS) $(TESTS_STRESS_OBJS): $(objroot)include/jemalloc/internal/private_namespace_jet.h - -$(C_SYM_OBJS) $(C_OBJS) $(C_PIC_OBJS) $(C_JET_SYM_OBJS) $(C_JET_OBJS) $(C_TESTLIB_OBJS) $(TESTS_OBJS): %.$(O): - @mkdir -p $(@D) - $(CC) $(CFLAGS) -c $(CPPFLAGS) $(CTARGET) $< -ifdef CC_MM - @$(CC) -MM $(CPPFLAGS) -MT $@ -o $(@:%.$(O)=%.d) $< -endif - -$(C_SYMS): %.sym: - @mkdir -p $(@D) - $(DUMP_SYMS) $< | $(AWK) -f $(objroot)include/jemalloc/internal/private_symbols.awk > $@ - -$(C_JET_SYMS): %.sym: - @mkdir -p $(@D) - $(DUMP_SYMS) $< | $(AWK) -f $(objroot)include/jemalloc/internal/private_symbols_jet.awk > $@ - -$(objroot)include/jemalloc/internal/private_namespace.gen.h: $(C_SYMS) - $(SHELL) $(srcroot)include/jemalloc/internal/private_namespace.sh $^ > $@ - -$(objroot)include/jemalloc/internal/private_namespace_jet.gen.h: $(C_JET_SYMS) - $(SHELL) $(srcroot)include/jemalloc/internal/private_namespace.sh $^ > $@ - -%.h: %.gen.h - @if ! `cmp -s $< $@` ; then echo "cp $< $<"; cp $< $@ ; fi - -$(CPP_OBJS) $(CPP_PIC_OBJS) $(TESTS_CPP_OBJS): %.$(O): - @mkdir -p $(@D) - $(CXX) $(CXXFLAGS) -c $(CPPFLAGS) $(CTARGET) $< -ifdef CC_MM - @$(CXX) -MM $(CPPFLAGS) -MT $@ -o $(@:%.$(O)=%.d) $< -endif - -ifneq ($(SOREV),$(SO)) -%.$(SO) : %.$(SOREV) - @mkdir -p $(@D) - ln -sf $(