gnzlbg / jemallocator

Rust allocator using jemalloc as a backend
Apache License 2.0
401 stars 106 forks source link

Compilation problem #91

Open leonardo-m opened 5 years ago

leonardo-m commented 5 years ago

I see that x86_64-pc-windows-gnu is supported, but when I try to use it in a test program I get the error messages (it can't find the specified file):

https://gist.github.com/rust-play/a29bb45bd2e6077616d1a5256072d4fb

gnzlbg commented 5 years ago

Windows CI is broken with the same error. It would be great if someone with access to a windows machine could give us a hand getting this up and running again.

In the meantime, if you have installed jemalloc on windows yourself, you can use the JEMALLOC_OVERRIDE environment variable to pick it up.

SimonSapin commented 5 years ago

I have access to a Windows machine. What is the appropriate C toolchain to install? I think it’s looking for gcc.exe which I don’t have. (Servo on Windows is built with MSVC.)

running: "sh" "/c/Users/Simon/projects/jemallocator/target/x86_64-pc-windows-gnu/debug/build/jemalloc-sys-fc11e55a94735c81/out/jemalloc/configure" "--disable-cxx" "--with-jemalloc-prefix=_rjem_" "--with-private-namespace=_rjem_" "--host=x86_64-w64-mingw32" "--build=x86_64-pc-win32" "--prefix=C:\\Users\\Simon\\projects\\jemallocator\\target\\x86_64-pc-windows-gnu\\debug\\build\\jemalloc-sys-fc11e55a94735c81\\out"
checking for xsltproc... /usr/bin/xsltproc
checking for x86_64-w64-mingw32-gcc... gcc.exe
checking whether the C compiler works... no

--- stderr
configure: error: in `/c/Users/Simon/projects/jemallocator/target/x86_64-pc-windows-gnu/debug/build/jemalloc-sys-fc11e55a94735c81/out/build':
configure: error: C compiler cannot create executables
gnzlbg commented 5 years ago

jemalloc itself can be built with both, msvc and mingw, the build.rs AFAICT never worked properly with either because rust-lang/rust never used it on windows

this is jemalloc's appveyor: https://github.com/jemalloc/jemalloc/blob/dev/.appveyor.yml

It uses MSYS2 and defines:

SimonSapin commented 5 years ago

After a round of choco install mingw I get to:

$ cargo build --target x86_64-pc-windows-gnu
[…]
checking build system type...
--- stderr
Invalid configuration `x86_64-pc-win32': system `win32' not recognized
configure: error: /bin/sh /c/Users/Simon/projects/jemallocator/target/x86_64-pc-windows-gnu/debug/build/jemalloc-sys-fc11e55a94735c81/out/jemalloc/build-aux/config.sub x86_64-pc-win32 failed
gnzlbg commented 5 years ago

https://github.com/alexcrichton/jemallocator/pull/95 should fix some path concatenation issues, but I don't know if you are getting there. Maybe you can try with that branch? There is a function in the build script that transforms the names of the windows targets before calling configure for some reason.

gnzlbg commented 5 years ago

It might be worth it to detect windows in the script, and depending on the target and toolchain, define inside the build.rs the CPU, MSVC, ... environment variables that the ./configure script might be using

SimonSapin commented 5 years ago

Same, with #95.

ErichDonGubler commented 5 years ago

@leonardo-m: If we could get your test code it'd reduce the barrier to entry for reproducing the problem even further!

gnzlbg commented 5 years ago

@ErichDonGubler AFAIK the library just doesn't build. That is:

git clone git@github.com:alexcrichton/jemallocator.git
cd jemallocator/jemalloc-sys
cargo build

should reproduce the issue on windows, pretty much independently of the windows target used.

The appveyor build bots hit this and they use MSYS2, and we don't have travis-ci windows build bots yet, but i've played a bit with those and they all hit these issues under GIT BASH. This happens for all targets: {x86_64,i686}-pc-windows-{gnu,msvc}.

ErichDonGubler commented 5 years ago

Even with the msvc targets, for some reason the build.rs is using an sh command invocation -- this is obviously wrong very odd. :\ I'm pretty sure that this is the source of the error that OP posted -- sh is the file not being found. I'm not familiar with how or even if jemalloc builds on MSVC, so I'm not familiar yet with what would need to change there to actually make it work with the msvc targets.

With the gnu targets, jemalloc fails compilation with several errors similar to this:

In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0,
                 from <snip>/jemallocator/target/debug/build/jemalloc-sys-174892ce6f5bf465/out/jemalloc/src/jemalloc.c:2:
<snip>/jemallocator/target/debug/build/jemalloc-sys-174892ce6f5bf465/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory
 #    include <sys/syscall.h>
              ^~~~~~~~~~~~~~~

This is expected to fail on MSYS2 because it uses other POSIX APIs to be cross-platform. I'm not with the APIs exposed by syscall.h.

gnzlbg commented 5 years ago

Even with the msvc targets, for some reason the build.rs is using an sh command invocation -- this is obviously wrong.

Yes, the build.rs unconditionally uses sh to run the configure script.

Looking at jemalloc's MSVC build bots upstream (e.g. see https://ci.appveyor.com/project/jasone/jemalloc/builds/20163016/job/e2xha8rtrqbudxg3?fullLog=true#L69) it appears that they invoke bash -c ... on windows to run autoconf and configure. I don't know if we can do something like this in the build.rs [0] - it would have to work on both MSYS2 (for appveyor) and GIT BASH (for travis-ci) at least.

Is there a better way of doing this ?

With the gnu targets, jemalloc fails compilation with several errors similar to this:

That's weird - could you build with cargo build -vv and upload the output to a gist ?


[0] on unixes' we ship a configure script in jemalloc-sys/configure/configure, but we are also able to build with autoconf and validate that the result of autoconf matches the one in jemalloc-sys/configure/configure. on windows we probably should not require autoconf, but we should support it - whether we might need to ship a different configure file, I don't know.

ErichDonGubler commented 5 years ago

@gnzlbg:

Is there a better way of doing this ?

Well, okay, it might just be me that's wrong. By a large margin CMake has been the de-facto standard for cross-platform compilations I've seen, but I've only worked with more "modern" C/C++ codebases recently. jemalloc has been around for a long time, so I could definitely understand why it simply expects to lean on nix tooling like autoconf. To me it's odd to require using nix tools to compile things with the MSVC toolchain nowadays, but I definitely don't consider myself "experienced". So, I'll edit my "obviously wrong" comment above. Whatever the case, I'd definitely be in favor of trying to remove the need for *nix tools if possible.

That's weird - could you build with cargo build -vv and upload the output to a gist ?

Would a few <detail> tags here work? I can still make a gist if you want.

Output of rustup show ``` active toolchain ---------------- stable-x86_64-pc-windows-gnu (default) rustc 1.30.1 (1433507eb 2018-11-07) ```
Output of cargo build -vv ``` ~/…/bug-reports/jemallocator master$ cargo build -vv Compiling fs_extra v1.1.0 Compiling cc v1.0.25 Compiling libc v0.2.43 Running `rustc --crate-name fs_extra 'C:\Users\egubler\.cargo\registry\src\github.com-1ecc6299db9ec823\fs_extra-1.1.0\src\lib.rs' --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=4c9aec95055aa5a3 -C extra-filename=-4c9aec95055aa5a3 --out-dir 'C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\deps' -L 'dependency=C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\deps' --cap-lints warn` Running `rustc --crate-name cc 'C:\Users\egubler\.cargo\registry\src\github.com-1ecc6299db9ec823\cc-1.0.25\src\lib.rs' --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=08849baf44eb6d2a -C extra-filename=-08849baf44eb6d2a --out-dir 'C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\deps' -L 'dependency=C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\deps' --cap-lints warn` Running `rustc --crate-name libc 'C:\Users\egubler\.cargo\registry\src\github.com-1ecc6299db9ec823\libc-0.2.43\src\lib.rs' --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=231547bf4f0805f4 -C extra-filename=-231547bf4f0805f4 --out-dir 'C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\deps' -L 'dependency=C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\deps' --cap-lints warn` warning: unused macro definition --> C:\Users\egubler\.cargo\registry\src\github.com-1ecc6299db9ec823\libc-0.2.43\src\macros.rs:51:1 | 51 | / macro_rules! f { 52 | | ($(pub fn $i:ident($($arg:ident: $argty:ty),*) -> $ret:ty { 53 | | $($body:stmt);* 54 | | })*) => ($( ... | 66 | | )*) 67 | | } | |_^ | = note: #[warn(unused_macros)] on by default Compiling jemalloc-sys v0.2.0 (C:\Users\egubler\workspace\personal\bug-reports\jemallocator\jemalloc-sys) Running `rustc --crate-name build_script_build 'jemalloc-sys\build.rs' --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 --cfg 'feature="background_threads_runtime_support"' -C metadata=c57d9f5c50f79ccb -C extra-filename=-c57d9f5c50f79ccb --out-dir 'C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-c57d9f5c50f79ccb' -C 'incremental=C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\incremental' -L 'dependency=C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\deps' --extern 'cc=C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\deps\libcc-08849baf44eb6d2a.rlib' --extern 'fs_extra=C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\deps\libfs_extra-4c9aec95055aa5a3.rlib'` Running `C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-c57d9f5c50f79ccb\build-script-build` TARGET=x86_64-pc-windows-gnu HOST=x86_64-pc-windows-gnu NUM_JOBS=8 OUT_DIR="C:\\Users\\egubler\\workspace\\personal\\bug-reports\\jemallocator\\target\\debug\\build\\jemalloc-sys-39a05dc36974796a\\out" BUILD_DIR="C:\\Users\\egubler\\workspace\\personal\\bug-reports\\jemallocator\\target\\debug\\build\\jemalloc-sys-39a05dc36974796a\\out\\build" SRC_DIR="C:\\Users\\egubler\\workspace\\personal\\bug-reports\\jemallocator\\jemalloc-sys" OPT_LEVEL = Some("0") TARGET = Some("x86_64-pc-windows-gnu") HOST = Some("x86_64-pc-windows-gnu") CC_x86_64-pc-windows-gnu = None CC_x86_64_pc_windows_gnu = None HOST_CC = None CC = None CFLAGS_x86_64-pc-windows-gnu = None CFLAGS_x86_64_pc_windows_gnu = None HOST_CFLAGS = None CFLAGS = None DEBUG = Some("true") CC="gcc.exe" CFLAGS="-O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall" JEMALLOC_SRC_DIR="C:\\Users\\egubler\\workspace\\personal\\bug-reports\\jemallocator\\target\\debug\\build\\jemalloc-sys-39a05dc36974796a\\out\\jemalloc" cargo:rustc-cfg=prefixed --with-jemalloc-prefix=_rjem_ running: "sh" "/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/configure" "--disable-cxx" "--with-jemalloc-prefix=_rjem_" "--with-private-namespace=_rjem_" "--host=x86_64-w64-mingw32" "--build=x86_64-w64-mingw32" "--prefix=C:\\Users\\egubler\\workspace\\personal\\bug-reports\\jemallocator\\target\\debug\\build\\jemalloc-sys-39a05dc36974796a\\out" configure: loading site script C:/msys64/etc/config.site checking for xsltproc... /usr/bin/xsltproc checking for x86_64-w64-mingw32-gcc... gcc.exe checking whether the C compiler works... yes checking for C compiler default output file name... a.exe checking for suffix of executables... .exe checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc.exe accepts -g... yes checking for gcc.exe option to accept ISO C89... none needed checking whether compiler is cray... no checking whether compiler supports -std=gnu11... yes checking whether compiler supports -Wall... yes checking whether compiler supports -Wshorten-64-to-32... no checking whether compiler supports -Wsign-compare... yes checking whether compiler supports -Wundef... yes checking whether compiler supports -Wno-format-zero-length... yes checking whether compiler supports -pipe... yes checking whether compiler supports -g3... yes checking how to run the C preprocessor... gcc.exe -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking whether byte ordering is bigendian... no checking size of void *... 8 checking size of int... 4 checking size of long... 8 checking size of long long... 8 checking size of intmax_t... 8 checking build system type... x86_64-w64-mingw32 checking host system type... x86_64-w64-mingw32 checking whether pause instruction is compilable... yes checking number of significant virtual address bits... 48 checking for x86_64-w64-mingw32-ar... no checking for ar... ar checking for x86_64-w64-mingw32-nm... no checking for nm... nm checking for gawk... gawk checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking whether malloc_usable_size definition can use const argument... no checking for library containing log... none required checking whether __attribute__ syntax is compilable... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether tls_model attribute is compilable... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether alloc_size attribute is compilable... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether format(gnu_printf, ...) attribute is compilable... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether format(printf, ...) attribute is compilable... yes checking for a BSD-compatible install... /usr/bin/install -c checking for x86_64-w64-mingw32-ranlib... no checking for ranlib... ranlib checking for ld... /usr/bin/ld checking for autoconf... /usr/bin/autoconf checking for memalign... yes checking for valloc... yes checking whether compiler supports -O3... yes checking whether compiler supports -O3... no checking whether compiler supports -funroll-loops... yes checking configured backtracing method... N/A checking for sbrk... yes checking whether utrace(2) is compilable... no checking whether a program using __builtin_unreachable is compilable... yes checking whether a program using __builtin_ffsl is compilable... yes checking LG_PAGE... 16 checking for library containing clock_gettime... none required checking whether clock_gettime(CLOCK_MONOTONIC_COARSE, ...) is compilable... no checking whether clock_gettime(CLOCK_MONOTONIC, ...) is compilable... yes checking whether mach_absolute_time() is compilable... no checking whether compiler supports -Werror... yes checking whether syscall(2) is compilable... no checking for secure_getenv... no checking for sched_getcpu... yes checking for sched_setaffinity... no checking for issetugid... yes checking for _malloc_thread_cleanup... no checking for _pthread_mutex_init_calloc_cb... no checking whether C11 atomics is compilable... yes checking whether GCC __atomic atomics is compilable... yes checking whether GCC __sync atomics is compilable... yes checking whether Darwin OSAtomic*() is compilable... no checking whether madvise(2) is compilable... yes checking whether madvise(..., MADV_FREE) is compilable... no checking whether madvise(..., MADV_DONTNEED) is compilable... yes checking whether madvise(..., MADV_DO[NT]DUMP) is compilable... no checking whether madvise(..., MADV_[NO]HUGEPAGE) is compilable... no checking whether to force 32-bit __sync_{add,sub}_and_fetch()... no checking whether to force 64-bit __sync_{add,sub}_and_fetch()... no checking for __builtin_clz... yes checking whether Darwin os_unfair_lock_*() is compilable... no checking whether Darwin OSSpin*() is compilable... no checking whether glibc malloc hook is compilable... no checking whether glibc memalign hook is compilable... no checking whether pthreads adaptive mutexes is compilable... no checking whether compiler supports -D_GNU_SOURCE... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether strerror_r returns char with gnu source is compilable... yes checking for stdbool.h that conforms to C99... yes checking for _Bool... yes configure: creating ./config.status config.status: creating Makefile config.status: creating jemalloc.pc config.status: creating doc/html.xsl config.status: creating doc/manpages.xsl config.status: creating doc/jemalloc.xml config.status: creating include/jemalloc/jemalloc_macros.h config.status: creating include/jemalloc/jemalloc_protos.h config.status: creating include/jemalloc/jemalloc_typedefs.h config.status: creating include/jemalloc/internal/jemalloc_preamble.h config.status: creating test/test.sh config.status: creating test/include/test/jemalloc_test.h config.status: creating config.stamp config.status: creating bin/jemalloc-config config.status: creating bin/jemalloc.sh config.status: creating bin/jeprof config.status: creating include/jemalloc/jemalloc_defs.h config.status: creating include/jemalloc/internal/jemalloc_internal_defs.h config.status: creating test/include/test/jemalloc_test_defs.h config.status: executing include/jemalloc/internal/public_symbols.txt commands config.status: executing include/jemalloc/internal/private_symbols.awk commands config.status: executing include/jemalloc/internal/private_symbols_jet.awk commands config.status: executing include/jemalloc/internal/public_namespace.h commands config.status: executing include/jemalloc/internal/public_unnamespace.h commands config.status: executing include/jemalloc/internal/size_classes.h commands config.status: executing include/jemalloc/jemalloc_protos_jet.h commands config.status: executing include/jemalloc/jemalloc_rename.h commands config.status: executing include/jemalloc/jemalloc_mangle.h commands config.status: executing include/jemalloc/jemalloc_mangle_jet.h commands config.status: executing include/jemalloc/jemalloc.h commands =============================================================================== jemalloc version : 0.1.4-157-g698010b8bc7b552acab02c2de05787f604f81aa2 library revision : 2 CONFIG : --disable-cxx --with-jemalloc-prefix=_rjem_ --with-private-namespace=_rjem_ --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-39a05dc36974796a\out build_alias=x86_64-w64-mingw32 host_alias=x86_64-w64-mingw32 CC=gcc.exe 'CFLAGS=-O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall' 'LDFLAGS=-O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall' 'CPPFLAGS=-O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall' CC : gcc.exe CONFIGURE_CFLAGS : -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops SPECIFIED_CFLAGS : -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall EXTRA_CFLAGS : CPPFLAGS : -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT CXX : CONFIGURE_CXXFLAGS : SPECIFIED_CXXFLAGS : EXTRA_CXXFLAGS : LDFLAGS : -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall EXTRA_LDFLAGS : DSO_LDFLAGS : -shared LIBS : RPATH_EXTRA : XSLTPROC : /usr/bin/xsltproc XSLROOT : PREFIX : C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-39a05dc36974796a\out BINDIR : C:Usersegublerworkspacepersonalbug-reportsjemallocatortargetdebugbuildjemalloc-sys-39a05dc36974796aout/bin DATADIR : C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-39a05dc36974796a\out/share INCLUDEDIR : C:Usersegublerworkspacepersonalbug-reportsjemallocatortargetdebugbuildjemalloc-sys-39a05dc36974796aout/include LIBDIR : C:Usersegublerworkspacepersonalbug-reportsjemallocatortargetdebugbuildjemalloc-sys-39a05dc36974796aout/lib MANDIR : C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-39a05dc36974796a\out/share/man srcroot : /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/ abs_srcroot : /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/ objroot : abs_objroot : /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/build/ JEMALLOC_PREFIX : _rjem_ JEMALLOC_PRIVATE_NAMESPACE : _rjem_je_ install_suffix : malloc_conf : autogen : 0 debug : 0 stats : 1 prof : 0 prof-libunwind : 0 prof-libgcc : 0 prof-gcc : 0 fill : 1 utrace : 0 xmalloc : 0 log : 0 lazy_lock : 0 cache-oblivious : 1 cxx : 0 =============================================================================== running: "make" "-j" "8" gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/jemalloc.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/jemalloc.c gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/arena.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/arena.c gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/background_thread.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/background_thread.c gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/base.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/base.c gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/bin.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/bin.c gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/bitmap.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/bitmap.c gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/ckh.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/ckh.c In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/jemalloc.c:2: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/background_thread.c:2: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/arena.c:2: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/ctl.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/ctl.c make: *** [Makefile:350: src/background_thread.sym.o] Error 1 make: *** Waiting for unfinished jobs.... make: *** [Makefile:350: src/arena.sym.o] Error 1 make: *** [Makefile:350: src/jemalloc.sym.o] Error 1 In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/bin.c:1: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/base.c:2: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/bitmap.c:2: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:350: src/bitmap.sym.o] Error 1 make: *** [Makefile:350: src/base.sym.o] Error 1 make: *** [Makefile:350: src/bin.sym.o] Error 1 In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/ckh.c:38: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:350: src/ckh.sym.o] Error 1 In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/ctl.c:2: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:350: src/ctl.sym.o] Error 1 thread 'main' panicked at 'command did not execute successfully: "make" "-j" "8" expected success, got: exit code: 2', jemalloc-sys\build.rs:363:9 note: Run with `RUST_BACKTRACE=1` for a backtrace. error: failed to run custom build command for `jemalloc-sys v0.2.0 (C:\Users\egubler\workspace\personal\bug-reports\jemallocator\jemalloc-sys)` process didn't exit successfully: `C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-c57d9f5c50f79ccb\build-script-build` (exit code: 101) --- stdout TARGET=x86_64-pc-windows-gnu HOST=x86_64-pc-windows-gnu NUM_JOBS=8 OUT_DIR="C:\\Users\\egubler\\workspace\\personal\\bug-reports\\jemallocator\\target\\debug\\build\\jemalloc-sys-39a05dc36974796a\\out" BUILD_DIR="C:\\Users\\egubler\\workspace\\personal\\bug-reports\\jemallocator\\target\\debug\\build\\jemalloc-sys-39a05dc36974796a\\out\\build" SRC_DIR="C:\\Users\\egubler\\workspace\\personal\\bug-reports\\jemallocator\\jemalloc-sys" OPT_LEVEL = Some("0") TARGET = Some("x86_64-pc-windows-gnu") HOST = Some("x86_64-pc-windows-gnu") CC_x86_64-pc-windows-gnu = None CC_x86_64_pc_windows_gnu = None HOST_CC = None CC = None CFLAGS_x86_64-pc-windows-gnu = None CFLAGS_x86_64_pc_windows_gnu = None HOST_CFLAGS = None CFLAGS = None DEBUG = Some("true") CC="gcc.exe" CFLAGS="-O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall" JEMALLOC_SRC_DIR="C:\\Users\\egubler\\workspace\\personal\\bug-reports\\jemallocator\\target\\debug\\build\\jemalloc-sys-39a05dc36974796a\\out\\jemalloc" cargo:rustc-cfg=prefixed --with-jemalloc-prefix=_rjem_ running: "sh" "/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/configure" "--disable-cxx" "--with-jemalloc-prefix=_rjem_" "--with-private-namespace=_rjem_" "--host=x86_64-w64-mingw32" "--build=x86_64-w64-mingw32" "--prefix=C:\\Users\\egubler\\workspace\\personal\\bug-reports\\jemallocator\\target\\debug\\build\\jemalloc-sys-39a05dc36974796a\\out" configure: loading site script C:/msys64/etc/config.site checking for xsltproc... /usr/bin/xsltproc checking for x86_64-w64-mingw32-gcc... gcc.exe checking whether the C compiler works... yes checking for C compiler default output file name... a.exe checking for suffix of executables... .exe checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc.exe accepts -g... yes checking for gcc.exe option to accept ISO C89... none needed checking whether compiler is cray... no checking whether compiler supports -std=gnu11... yes checking whether compiler supports -Wall... yes checking whether compiler supports -Wshorten-64-to-32... no checking whether compiler supports -Wsign-compare... yes checking whether compiler supports -Wundef... yes checking whether compiler supports -Wno-format-zero-length... yes checking whether compiler supports -pipe... yes checking whether compiler supports -g3... yes checking how to run the C preprocessor... gcc.exe -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking whether byte ordering is bigendian... no checking size of void *... 8 checking size of int... 4 checking size of long... 8 checking size of long long... 8 checking size of intmax_t... 8 checking build system type... x86_64-w64-mingw32 checking host system type... x86_64-w64-mingw32 checking whether pause instruction is compilable... yes checking number of significant virtual address bits... 48 checking for x86_64-w64-mingw32-ar... no checking for ar... ar checking for x86_64-w64-mingw32-nm... no checking for nm... nm checking for gawk... gawk checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking whether malloc_usable_size definition can use const argument... no checking for library containing log... none required checking whether __attribute__ syntax is compilable... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether tls_model attribute is compilable... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether alloc_size attribute is compilable... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether format(gnu_printf, ...) attribute is compilable... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether format(printf, ...) attribute is compilable... yes checking for a BSD-compatible install... /usr/bin/install -c checking for x86_64-w64-mingw32-ranlib... no checking for ranlib... ranlib checking for ld... /usr/bin/ld checking for autoconf... /usr/bin/autoconf checking for memalign... yes checking for valloc... yes checking whether compiler supports -O3... yes checking whether compiler supports -O3... no checking whether compiler supports -funroll-loops... yes checking configured backtracing method... N/A checking for sbrk... yes checking whether utrace(2) is compilable... no checking whether a program using __builtin_unreachable is compilable... yes checking whether a program using __builtin_ffsl is compilable... yes checking LG_PAGE... 16 checking for library containing clock_gettime... none required checking whether clock_gettime(CLOCK_MONOTONIC_COARSE, ...) is compilable... no checking whether clock_gettime(CLOCK_MONOTONIC, ...) is compilable... yes checking whether mach_absolute_time() is compilable... no checking whether compiler supports -Werror... yes checking whether syscall(2) is compilable... no checking for secure_getenv... no checking for sched_getcpu... yes checking for sched_setaffinity... no checking for issetugid... yes checking for _malloc_thread_cleanup... no checking for _pthread_mutex_init_calloc_cb... no checking whether C11 atomics is compilable... yes checking whether GCC __atomic atomics is compilable... yes checking whether GCC __sync atomics is compilable... yes checking whether Darwin OSAtomic*() is compilable... no checking whether madvise(2) is compilable... yes checking whether madvise(..., MADV_FREE) is compilable... no checking whether madvise(..., MADV_DONTNEED) is compilable... yes checking whether madvise(..., MADV_DO[NT]DUMP) is compilable... no checking whether madvise(..., MADV_[NO]HUGEPAGE) is compilable... no checking whether to force 32-bit __sync_{add,sub}_and_fetch()... no checking whether to force 64-bit __sync_{add,sub}_and_fetch()... no checking for __builtin_clz... yes checking whether Darwin os_unfair_lock_*() is compilable... no checking whether Darwin OSSpin*() is compilable... no checking whether glibc malloc hook is compilable... no checking whether glibc memalign hook is compilable... no checking whether pthreads adaptive mutexes is compilable... no checking whether compiler supports -D_GNU_SOURCE... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether strerror_r returns char with gnu source is compilable... yes checking for stdbool.h that conforms to C99... yes checking for _Bool... yes configure: creating ./config.status config.status: creating Makefile config.status: creating jemalloc.pc config.status: creating doc/html.xsl config.status: creating doc/manpages.xsl config.status: creating doc/jemalloc.xml config.status: creating include/jemalloc/jemalloc_macros.h config.status: creating include/jemalloc/jemalloc_protos.h config.status: creating include/jemalloc/jemalloc_typedefs.h config.status: creating include/jemalloc/internal/jemalloc_preamble.h config.status: creating test/test.sh config.status: creating test/include/test/jemalloc_test.h config.status: creating config.stamp config.status: creating bin/jemalloc-config config.status: creating bin/jemalloc.sh config.status: creating bin/jeprof config.status: creating include/jemalloc/jemalloc_defs.h config.status: creating include/jemalloc/internal/jemalloc_internal_defs.h config.status: creating test/include/test/jemalloc_test_defs.h config.status: executing include/jemalloc/internal/public_symbols.txt commands config.status: executing include/jemalloc/internal/private_symbols.awk commands config.status: executing include/jemalloc/internal/private_symbols_jet.awk commands config.status: executing include/jemalloc/internal/public_namespace.h commands config.status: executing include/jemalloc/internal/public_unnamespace.h commands config.status: executing include/jemalloc/internal/size_classes.h commands config.status: executing include/jemalloc/jemalloc_protos_jet.h commands config.status: executing include/jemalloc/jemalloc_rename.h commands config.status: executing include/jemalloc/jemalloc_mangle.h commands config.status: executing include/jemalloc/jemalloc_mangle_jet.h commands config.status: executing include/jemalloc/jemalloc.h commands =============================================================================== jemalloc version : 0.1.4-157-g698010b8bc7b552acab02c2de05787f604f81aa2 library revision : 2 CONFIG : --disable-cxx --with-jemalloc-prefix=_rjem_ --with-private-namespace=_rjem_ --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-39a05dc36974796a\out build_alias=x86_64-w64-mingw32 host_alias=x86_64-w64-mingw32 CC=gcc.exe 'CFLAGS=-O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall' 'LDFLAGS=-O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall' 'CPPFLAGS=-O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall' CC : gcc.exe CONFIGURE_CFLAGS : -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops SPECIFIED_CFLAGS : -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall EXTRA_CFLAGS : CPPFLAGS : -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT CXX : CONFIGURE_CXXFLAGS : SPECIFIED_CXXFLAGS : EXTRA_CXXFLAGS : LDFLAGS : -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall EXTRA_LDFLAGS : DSO_LDFLAGS : -shared LIBS : RPATH_EXTRA : XSLTPROC : /usr/bin/xsltproc XSLROOT : PREFIX : C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-39a05dc36974796a\out BINDIR : C:Usersegublerworkspacepersonalbug-reportsjemallocatortargetdebugbuildjemalloc-sys-39a05dc36974796aout/bin DATADIR : C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-39a05dc36974796a\out/share INCLUDEDIR : C:Usersegublerworkspacepersonalbug-reportsjemallocatortargetdebugbuildjemalloc-sys-39a05dc36974796aout/include LIBDIR : C:Usersegublerworkspacepersonalbug-reportsjemallocatortargetdebugbuildjemalloc-sys-39a05dc36974796aout/lib MANDIR : C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-39a05dc36974796a\out/share/man srcroot : /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/ abs_srcroot : /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/ objroot : abs_objroot : /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/build/ JEMALLOC_PREFIX : _rjem_ JEMALLOC_PRIVATE_NAMESPACE : _rjem_je_ install_suffix : malloc_conf : autogen : 0 debug : 0 stats : 1 prof : 0 prof-libunwind : 0 prof-libgcc : 0 prof-gcc : 0 fill : 1 utrace : 0 xmalloc : 0 log : 0 lazy_lock : 0 cache-oblivious : 1 cxx : 0 =============================================================================== running: "make" "-j" "8" gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/jemalloc.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/jemalloc.c gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/arena.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/arena.c gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/background_thread.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/background_thread.c gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/base.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/base.c gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/bin.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/bin.c gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/bitmap.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/bitmap.c gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/ckh.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/ckh.c gcc.exe -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -O3 -funroll-loops -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -c -O0 -ffunction-sections -fdata-sections -g -fno-omit-frame-pointer -m64 -Wall -D_REENTRANT -Iinclude -I/c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/ctl.sym.o /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/ctl.c --- stderr In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/jemalloc.c:2: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/background_thread.c:2: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/arena.c:2: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:350: src/background_thread.sym.o] Error 1 make: *** Waiting for unfinished jobs.... make: *** [Makefile:350: src/arena.sym.o] Error 1 make: *** [Makefile:350: src/jemalloc.sym.o] Error 1 In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/bin.c:1: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/base.c:2: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/bitmap.c:2: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:350: src/bitmap.sym.o] Error 1 make: *** [Makefile:350: src/base.sym.o] Error 1 make: *** [Makefile:350: src/bin.sym.o] Error 1 In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/ckh.c:38: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:350: src/ckh.sym.o] Error 1 In file included from include/jemalloc/internal/jemalloc_preamble.h:5:0, from /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/src/ctl.c:2: /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h:22:14: fatal error: sys/syscall.h: No such file or directory # include ^~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:350: src/ctl.sym.o] Error 1 thread 'main' panicked at 'command did not execute successfully: "make" "-j" "8" expected success, got: exit code: 2', jemalloc-sys\build.rs:363:9 note: Run with `RUST_BACKTRACE=1` for a backtrace. ```
gnzlbg commented 5 years ago

To me it's odd to require using *nix tools to compile things with the MSVC toolchain nowadays,

It is, there is an issue open about using CMake with jemalloc, but it is a non-trivial amount of work.

I'd definitely be in favor of trying to remove the need for *nix tools if possible.

Yes, this is why we try to ship a configure (or more) that work on the hosts, so that autoconf is not required and one only needs sh, which is nowadays available almost everywhere. jemalloc upstream uses bash though, so maybe upgrading from sh to bash could work under MSYS2?

Would a few tags here work?

Sure, thanks! So one weird thing is this:

PREFIX             : C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-39a05dc36974796a\out
BINDIR             : C:Usersegublerworkspacepersonalbug-reportsjemallocatortargetdebugbuildjemalloc-sys-39a05dc36974796aout/bin
DATADIR            : C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-39a05dc36974796a\out/share
INCLUDEDIR         : C:Usersegublerworkspacepersonalbug-reportsjemallocatortargetdebugbuildjemalloc-sys-39a05dc36974796aout/include
LIBDIR             : C:Usersegublerworkspacepersonalbug-reportsjemallocatortargetdebugbuildjemalloc-sys-39a05dc36974796aout/lib
MANDIR             : C:\Users\egubler\workspace\personal\bug-reports\jemallocator\target\debug\build\jemalloc-sys-39a05dc36974796a\out/share/man

srcroot            : /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/
abs_srcroot        : /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/jemalloc/
objroot            :
abs_objroot        : /c/Users/egubler/workspace/personal/bug-reports/jemallocator/target/debug/build/jemalloc-sys-39a05dc36974796a/out/build/

Some paths appear right, some use the /c/Users/... syntax, and some are missing the slashes /, including the include paths, which would explain why the headers are not being found. I don't know what's in charge of setting the INCLUDEDIR (is it the build.rs? jemalloc's config script, the users?), but it appears very wrong, same for LIBDIR.

ErichDonGubler commented 5 years ago

@gnzlbg: Yeah, the same applies to BINDIR too. Let me investigate that...

ErichDonGubler commented 5 years ago

@gnzlbg: I don't believe these paths are making a difference. I forced the paths to contain forward slashes with this patch:

diff --git a/jemalloc-sys/build.rs b/jemalloc-sys/build.rs
index 6909f96..d672ca9 100644
--- a/jemalloc-sys/build.rs
+++ b/jemalloc-sys/build.rs
@@ -298,7 +298,9 @@ fn main() {

     cmd.arg(format!("--host={}", gnu_target(&target)));
     cmd.arg(format!("--build={}", gnu_target(&host)));
-    cmd.arg(format!("--prefix={}", out_dir.display()));
+    let mut out_dir_string = out_dir.display().to_string();
+    out_dir_string = out_dir_string.replace("\\", "/");
+    cmd.arg(format!("--prefix={}", out_dir_string));

     run(&mut cmd);

...and now they print like this:

PREFIX             : C:/msys64/home/K0RYU/workspace/bug-reports/jemallocator/target/debug/build/jemalloc-sys-1566e241d4cd2bb0/out
BINDIR             : C:/msys64/home/K0RYU/workspace/bug-reports/jemallocator/target/debug/build/jemalloc-sys-1566e241d4cd2bb0/out/bin
DATADIR            : C:/msys64/home/K0RYU/workspace/bug-reports/jemallocator/target/debug/build/jemalloc-sys-1566e241d4cd2bb0/out/share
INCLUDEDIR         : C:/msys64/home/K0RYU/workspace/bug-reports/jemallocator/target/debug/build/jemalloc-sys-1566e241d4cd2bb0/out/include
LIBDIR             : C:/msys64/home/K0RYU/workspace/bug-reports/jemallocator/target/debug/build/jemalloc-sys-1566e241d4cd2bb0/out/lib
MANDIR             : C:/msys64/home/K0RYU/workspace/bug-reports/jemallocator/target/debug/build/jemalloc-sys-1566e241d4cd2bb0/out/share/man

...but I'm getting the same compilation errors anyway -- that makes sense, since these are technically output folders and depend on a finished compilation first! #include <sys/syscall.h> is simply not expected to work on MSYS2/Git Bash platforms (which are really the same thing, but the latter has a subset of functionality). mingw upstream even says this on their wiki (emphasis mine):

Unlike Cygwin, MinGW doesn't provide Linux or Unix system calls or a POSIX emulation layer. Some POSIX compatibility is provided by the supported runtime library, msvcrt.dll. A few additional functions are provided to help with portability. However, most likely a POSIX application would need to be ported to use Windows APIs in order to compile with MinGW, just as you would to compile with MSVC or Borland or Watcom C++.


jemalloc upstream uses bash though, so maybe upgrading from sh to bash could work under MSYS2?

I doubt that this would make a meaningful difference for the autoconf usages, but it WOULD let you use jemalloc-sys/jemalloc/runtests.sh out-of-the-box. Looking at the jemalloc-sys/jemalloc/scripts/gen_run_tests.py file that it uses to generate test code for bash, I don't see anything that immediately looks like it shouldn't just run in sh, but forcing sh would require either upstream changes or a patch for this crate.

ErichDonGubler commented 5 years ago

So, to me, the real question is: why is jemalloc, as jemallocator's build.rs is configuring it, expecting POSIX syscalls right now?

gnzlbg commented 5 years ago

@ErichDonGubler

<sys/syscall.h> is simply not expected to work on MSYS2/Git Bash platforms

note that jemalloc's own CI uses appveyor with MSYS2 (https://github.com/jemalloc/jemalloc/blob/dev/.appveyor.yml), and the only thing they do is bash -c "autoconf", bash -c "./configure", mingw32-make -k check, and that works out of the box, both for gnu and msvc toolchains and for both x86_64 and i686 targets.

ErichDonGubler commented 5 years ago

@gnzlbg: So, I decided to take your suggestion and explore what upstream does with Appveyor. I've managed to make things compile and have eliminated all but one issue getting this to work on my fork's Appveyor -- I hope to have enough time in the next couple of days to resolve the issue and make a PR. :)

ErichDonGubler commented 5 years ago

I have managed to make gnu targets compile with a few more changes! Would you like me to make a PR with just gnu targets, or would you want me to roll in msvc targets too?

gnzlbg commented 5 years ago

@ErichDonGubler Sure, a PR that allows the gnu targets to work would be a great improvement already :) You can always send a PR that fixed the msvc targets later! Thanks for looking into this!