Commit Graph

6154 Commits

Author SHA1 Message Date
Andrew Kelley
40e77dad83
musl [PATCH] arm: fix setjmp and longjmp asm for armv8-a
From: Szabolcs Nagy <szabolcs.nagy@arm.com>

armv8 removed the coprocessor instructions other than cp14, so
on an armv8 system the related hwcaps should never be set.

new llvm complains about the use of coprocessor instructions in
armv8-a mode (even though they are never executed at runtime),
so ifdef them out when musl is built for armv8.

<dalias> i think the patch looks ok
2019-09-25 15:15:52 -04:00
Andrew Kelley
dc3c4197c6
disable known-to-be-failing tests for linux-aarch64-gnueabihf
See #3288. Root cause appears to be #3291.
2019-09-25 14:17:46 -04:00
Andrew Kelley
c9690916e5
fix building musl on eabihf abis, incorrect include dirs
See #3286. The issue is not fully solved however because this has
uncovered another issue.
2019-09-25 14:03:26 -04:00
Vexu
14ae23326e ran zig fmt on stdlib 2019-09-25 12:44:11 -04:00
Vexu
29e6541db1 add noasync to zig fmt 2019-09-25 12:44:11 -04:00
LemonBoy
3907e3b675 Fix llseek behavior 2019-09-25 12:10:58 -04:00
Andrew Kelley
48c9e17aa1
Merge pull request #3308 from LemonBoy/riscv-things
Miscellaneous RISC-V related commits
2019-09-25 12:08:47 -04:00
LemonBoy
a56b767c35 Add DTP bias according to RISCV ABI 2019-09-25 18:07:17 +02:00
LemonBoy
453157595e Correct some RISCV64 bits 2019-09-25 09:30:44 +02:00
Andrew Kelley
993d5bc9c9
add docs for usingnamespace
closes #1589
2019-09-24 21:23:12 -04:00
Andrew Kelley
53210b2304
better default enabled features for riscv
Until ability to specify target CPU features (#2883) is done, this
commit gives riscv target better default features.

This side-steps #3275 which is a deficiency in compiler-rt when features
do not include 32 bit integer division.

With this commit, RISC-V compiler-rt tests pass and Hello World works
both pure-zig and with musl libc.
2019-09-24 20:56:04 -04:00
Michael Dusan
9983501ff2 add VarDecl support for struct-method call syntax
implements #3306
2019-09-24 19:24:48 -04:00
Andrew Kelley
56b1818beb
docgen: test blocks support linking libc 2019-09-24 11:41:19 -04:00
Andrew Kelley
c0b937ba12
docgen: slightly cleaner display of libc cli args 2019-09-24 11:36:59 -04:00
LemonBoy
5fb7af26ab
Fix result loc unwrapping with optional in error union
Fixes #2899
2019-09-24 01:09:26 -04:00
LemonBoy
93367adaa7
Fix assignment to optional payload
Closes #3081
2019-09-24 00:31:35 -04:00
Jay Weisskopf
0bdc85181c Create user-specified output-dir
Fixes #2637
2019-09-24 00:20:29 -04:00
LemonBoy
663e665843
Prevent crash with invalid extern type
Fixes #3240
2019-09-23 17:30:28 -04:00
LemonBoy
db988f42a7 Fix computation of switch coverage
Closes #3258
2019-09-23 16:13:28 -04:00
Andrew Kelley
53ae03ebe9
make type_allowed_in_extern more robust
Previously if the type parameter was a pointer, it would assert that the
size of the type was resolved. It used to be that the size of pointers was
always resolved, however with lazy values, pointers gained the
possibility of not having their size resolved.

Now, type_allowed_in_extern triggers the resolution of whether a pointer
is zero bits, and returns a possible error if the resolution fails.

This fixes a compiler assertion when building the
[zootdeck project](https://github.com/donpdonp/zootdeck). I do not have
a test case reduction for the issue.
2019-09-23 15:02:38 -04:00
Andrew Kelley
29b82d20a4 zig build: linkSystemLibrary integrates with pkg-config
* add -D CLI option for setting C macros
 * add std.ascii.allocLowerString
 * add std.ascii.eqlIgnoreCase
 * add std.ascii.indexOfIgnoreCasePos
 * add std.ascii.indexOfIgnoreCase
2019-09-23 14:45:14 -04:00
Andrew Kelley
35c1d8cefc
Merge pull request #3290 from ziglang/more-test-coverage
significantly increase test coverage
2019-09-22 21:18:27 -04:00
Andrew Kelley
55925b6e25
windows CI: fix name collision
Previously the CMAKE_BUILD_TYPE=Release was conflicting with the
"distribution" directory `release`. I renamed this to `dist` so that
it won't conflict with any build types.
2019-09-22 19:47:07 -04:00
Andrew Kelley
96affd683a
enable test coverage for cross compiling windows mingw-w64
closes #3285
2019-09-22 19:11:41 -04:00
Andrew Kelley
c161ce3f7c
mingw-w64 libc: fix incorrect detection of _xgetbv
It was using __GNUC__ < 8 to check if _xgetbv intrinsic is available.
Since we always use zig cc with this header, we know we have clang 9,
which does have this intrinsic.
2019-09-22 19:10:27 -04:00
Andrew Kelley
23f339f1b4
add emscripten to std.build.Target.defaultAbi
After upgrading to LLVM 9 we now have the emscripten OS available. Fix
the compile error in this function by specifying the default ABI for
emscripten.
2019-09-22 19:10:18 -04:00
Andrew Kelley
989cd4233e
Merge pull request #3298 from ziglang/gethostname
gethostname
2019-09-22 18:19:37 -04:00
Andrew Kelley
d6f7b573aa silence nonportable include path warnings when building glibc on windows 2019-09-22 18:15:30 -04:00
Andrew Kelley
f14ba904d7
tolerate windows newlines in glibc text files 2019-09-22 18:14:53 -04:00
Andrew Kelley
2c8495b4bb
git, I love you, but please stop mangling my files 2019-09-22 18:11:55 -04:00
Andrew Kelley
a239c7439f
more helpful error message when failing to parse glibc abi.txt 2019-09-22 17:41:15 -04:00
Andrew Kelley
31b72da84a
more info in assertion failures 2019-09-22 16:40:48 -04:00
Andrew Kelley
028011e59a
libc implementation of gethostname 2019-09-22 16:07:21 -04:00
Andrew Kelley
65b495af58
windows CI: use MinSizeRel to work around MSVC bug
See #3024
2019-09-22 15:59:06 -04:00
Andrew Kelley
1d6d6d5228
remove redundant assert 2019-09-22 15:58:57 -04:00
Andrew Kelley
12b195f9d5
ci: update windows image to MSVC 2019 2019-09-22 15:32:52 -04:00
Andrew Kelley
cf4cc9b148
do the release tests last because they take longer 2019-09-22 14:41:47 -04:00
Andrew Kelley
786052c7d3 disable running cross compiled macos tests
due to #3295
2019-09-22 14:40:54 -04:00
Andrew Kelley
9627a75b07 clean up compiler_rt with some enum literals 2019-09-22 14:00:05 -04:00
Andrew Kelley
e63daca92e
linux implementation of std.net.getHostName 2019-09-22 11:48:53 -04:00
Euan Torano
8a15537c6e Fix #3272 - update docs 2019-09-22 11:23:00 -04:00
Andrew Kelley
2510edeb71
fix linux stat struct on aarch64
The ABI was incorrect.
2019-09-22 11:22:22 -04:00
Andrew Kelley
dc2463d9a9
windows ci: make the case of file names agree 2019-09-22 11:22:22 -04:00
Andrew Kelley
ffef5d26b6
significantly increase test coverage
* add zig build option `-Dskip-libc` to skip tests that build libc
   (e.g. if you don't want to wait for musl to build)
 * add `-Denable-wine` option which uses wine to run cross compiled
   windows tests on non-windows hosts
 * add `-Denable-qemu` option which uses qemu to run cross compiled
   foreign architecture tests
 * add `-Denable-foreign-glibc=path` option which combined with
   `-Denable-qemu` enables running cross compiled tests that link
   against glibc. See
   https://github.com/ziglang/zig/wiki/Updating-libc#glibc for how to
   produce this directory.
 * the test matrix is done manually. release test builds are only
   enabled by default for the native target. this should save us some CI
   time, while still providing decent coverage of release builds.
   - add test coverage for `x86_64-linux-musl -lc` (building musl libc)
   - add test coverage for `x86_64-linux-gnu -lc` (building glibc)
   - add test coverage for `aarch64v8_5a-linux-none`
   - add test coverage for `aarch64v8_5a-linux-musl -lc` (building musl libc)
   - add test coverage for `aarch64v8_5a-linux-gnu -lc` (building glibc)
   - add test coverage for `arm-linux-none`
   - test coverage for `arm-linux-musleabihf -lc` (building musl libc) is
     disabled due to #3286
   - test coverage for `arm-linux-gnueabihf -lc` (building glibc) is disabled
     due to #3287
   - test coverage for `x86_64-windows-gnu -lc` (building mingw-w64) is
     disabled due to #3285
 * enable qemu testing on the Linux CI job. There's not really a good
   reason to enable wine, since we have a Windows CI job as well.
 * remove the no longer needed `--build-file ../build.zig` from CI
   scripts
 * fix bug in glibc compilation where it wasn't properly reading the abi
   list txt files, resulting in "key not found" error.
 * std.build.Target gains:
   - isNetBSD
   - isLinux
   - osRequiresLibC
   - getArchPtrBitWidth
   - getExternalExecutor
 * zig build system gains support for enabling wine and enabling qemu.
   `artifact.enable_wine = true;`, `artifact.enable_qemu = true;`. This
   communicates that the system has these tools installed and the build
   system will use them to run tests.
 * zig build system gains support for overriding the dynamic linker of
   an executable artifact.
 * fix std.c.lseek prototype. makes behavior tests for
   arm-linux-musleabihf pass.
 * disable std lib tests that are failing on ARM. See #3288, #3289
 * provide `std.os.off_t`.
 * disable some of the compiler_rt symbols for arm 32 bit. Fixes
   compiler_rt tests for arm 32 bit
 * add __stack_chk_guard when linking against glibc. Fixes std lib tests
   for aarch64-linux-gnu
 * workaround for "unable to inline function" using `@inlineCall`. Fixes
   compiler_rt tests for arm 32 bit.
2019-09-22 11:22:17 -04:00
Michael Dusan
c5716715d5 stage1: fix lost argv[0]
- bug presented on FreeBSD when `/proc` filesystem is not mounted
- bogus `cc` was used as exename, causing incorrect executable spawn
- llvm::sys::fs::getMainExecutable() has platform-specific code
  to get exename and fallback is to use param argv0
- linux fallback is rare because `/proc` is usually mounted
- *BSD fallback is not rare because `/proc` is often not mounted
- macOS doesn't ever fallback: bug cannot present
- windows doesn't ever fallback: bug cannot present
- other Posix will always present
2019-09-22 11:21:22 -04:00
LemonBoy
a11c20e26a Fix TLS for VariantI arches with a twist 2019-09-21 19:53:39 -04:00
Andrew Kelley
4dd17a7c9e
zig test: don't skip execution when explicit command provided 2019-09-21 15:57:09 -04:00
Andrew Kelley
2c681d7ba1
add behavior test for float widening f16 to f128
it's disabled on aarch64, see #3282
2019-09-21 14:22:23 -04:00
Andrew Kelley
f3a7c346dd
Merge pull request #3278 from LemonBoy/struct-gen
A few steps towards AArch64 & ARM passing the behavior tests
2019-09-21 13:46:13 -04:00
Andrew Kelley
533aff3a6a
Merge pull request #3238 from Tetralux/fixed-allocator-reset
FixedBufferAllocator.reset
2019-09-21 12:48:45 -04:00