Skip to content

Support dynamically-linked NetBSD libc when cross-compiling #23913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9e48e91
.gitattributes: Mark abilists files as binary.
alexrp May 12, 2025
e52ffe6
glibc: Fix a benign bug when selecting the size of an object symbol.
alexrp May 12, 2025
76d525f
freebsd: Remove dead Thumb handling code.
alexrp May 16, 2025
0d35a77
freebsd: Fix selection of unversioned symbol inclusion.
alexrp May 16, 2025
d47cc57
test: Remove some nonsensical NetBSD targets from llvm_targets.
alexrp May 13, 2025
9af8e7c
std.c: Fill out some missing definitions for supported NetBSD libc ta…
alexrp May 16, 2025
3d6f83b
std.Target: Adjust DynamicLinker.standard() for NetBSD.
alexrp May 13, 2025
8a7d925
std.Target: Fix requiresLibC() for NetBSD.
alexrp May 12, 2025
6028db7
std.Target: Add isNetBSDLibC() function.
alexrp May 12, 2025
4371e69
process_headers: Add NetBSD libc support.
alexrp May 12, 2025
553cb3e
libc: Add NetBSD system and libc headers from 10.1.
alexrp May 12, 2025
35f8121
std.zig.LibCDirs: Add NetBSD libc support.
alexrp May 12, 2025
1c342ca
libc: Add NetBSD libc startup code from 10.1.
alexrp May 12, 2025
90911b3
update_netbsd_libc: Add tool for updating NetBSD libc startup code.
alexrp May 12, 2025
c36d483
libc: Add NetBSD libc abilists file.
alexrp May 12, 2025
e20fb70
compiler: Define __NetBSD_Version__ when targeting NetBSD libc.
alexrp May 12, 2025
a090ef0
std.zig.target: Add NetBSD libc support.
alexrp May 12, 2025
1a82cce
std.Target: Factor arch/ABI into NetBSD minimum OS version selection.
alexrp May 12, 2025
d29ba75
Compilation.Config: Default to dynamic linking with NetBSD libc.
alexrp May 12, 2025
c5e669f
compiler: Link libc by default when targeting NetBSD.
alexrp May 12, 2025
a97e417
compiler: Support building NetBSD crt1.o/Scrt1.o and stub shared libr…
alexrp May 12, 2025
cd1eea0
freebsd: Fix stub libraries containing versioned symbols that shouldn…
alexrp May 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*.txt text eol=lf
langref.html.in text eol=lf

lib/libc/*/abilists binary

lib/std/compress/testdata/** binary
lib/std/compress/flate/testdata/** binary
lib/std/compress/lzma/testdata/** binary
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ set(ZIG_STAGE2_SOURCES
src/dev.zig
src/libs/freebsd.zig
src/libs/glibc.zig
src/libs/netbsd.zig
src/introspect.zig
src/libs/libcxx.zig
src/libs/libtsan.zig
Expand Down
3 changes: 3 additions & 0 deletions lib/libc/include/aarch64-netbsd-none/aarch64/ansi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* $NetBSD: ansi.h,v 1.1 2014/08/10 05:47:37 matt Exp $ */

#include <arm/ansi.h>
37 changes: 37 additions & 0 deletions lib/libc/include/aarch64-netbsd-none/aarch64/aout_machdep.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* $NetBSD: aout_machdep.h,v 1.2 2018/04/01 04:35:03 ryo Exp $ */

/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef _AARCH64_AOUT_MACHDEP_H_
#define _AARCH64_AOUT_MACHDEP_H_

#include <arm/aout_machdep.h>

#endif /* !_AARCH64_AOUT_MACHDEP_H_ */
Loading