Skip to content

Commit

Permalink
Merge pull request #382 from briantting/musl
Browse files Browse the repository at this point in the history
Update third_party/musl subtree.

b/277595686
  • Loading branch information
kaidokert authored May 19, 2023
2 parents c57ca6c + d7577d9 commit 9d71f6c
Show file tree
Hide file tree
Showing 1,452 changed files with 19,412 additions and 9,626 deletions.
1 change: 1 addition & 0 deletions third_party/musl/.mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ada Worcester <[email protected]> <[email protected]>
34 changes: 23 additions & 11 deletions third_party/musl/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 The Cobalt Authors. All Rights Reserved.
# Copyright 2023 The Cobalt Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,8 +20,6 @@ if (target_cpu == "x64") {
musl_arch = "arm"
} else if (target_cpu == "arm64") {
musl_arch = "aarch64"
} else if (target_cpu == "mips") {
musl_arch = "mips"
}

config("external_settings") {
Expand All @@ -43,6 +41,7 @@ static_library("c_internal") {
visibility = [ ":c" ]

include_dirs = [
"src/include",
"src/starboard/internal",
"src/errno",
"src/multibyte",
Expand Down Expand Up @@ -131,6 +130,17 @@ static_library("c_internal") {
"src/math/__fpclassifyf.c",
"src/math/__fpclassifyl.c",
"src/math/__invtrigl.c",
"src/math/__math_divzero.c",
"src/math/__math_divzerof.c",
"src/math/__math_invalid.c",
"src/math/__math_invalidf.c",
"src/math/__math_invalidl.c",
"src/math/__math_oflow.c",
"src/math/__math_oflowf.c",
"src/math/__math_uflow.c",
"src/math/__math_uflowf.c",
"src/math/__math_xflow.c",
"src/math/__math_xflowf.c",
"src/math/__polevll.c",
"src/math/__rem_pio2.c",
"src/math/__rem_pio2_large.c",
Expand Down Expand Up @@ -185,11 +195,13 @@ static_library("c_internal") {
"src/math/erff.c",
"src/math/erfl.c",
"src/math/exp.c",
"src/math/exp_data.c",
"src/math/exp10.c",
"src/math/exp10f.c",
"src/math/exp10l.c",
"src/math/exp2.c",
"src/math/exp2f.c",
"src/math/exp2f_data.c",
"src/math/exp2l.c",
"src/math/expf.c",
"src/math/expl.c",
Expand Down Expand Up @@ -249,19 +261,23 @@ static_library("c_internal") {
"src/math/llroundf.c",
"src/math/llroundl.c",
"src/math/log.c",
"src/math/log_data.c",
"src/math/log10.c",
"src/math/log10f.c",
"src/math/log10l.c",
"src/math/log1p.c",
"src/math/log1pf.c",
"src/math/log1pl.c",
"src/math/log2.c",
"src/math/log2_data.c",
"src/math/log2f.c",
"src/math/log2f_data.c",
"src/math/log2l.c",
"src/math/logb.c",
"src/math/logbf.c",
"src/math/logbl.c",
"src/math/logf.c",
"src/math/logf_data.c",
"src/math/logl.c",
"src/math/lrint.c",
"src/math/lrintf.c",
Expand All @@ -285,7 +301,9 @@ static_library("c_internal") {
"src/math/nexttowardf.c",
"src/math/nexttowardl.c",
"src/math/pow.c",
"src/math/pow_data.c",
"src/math/powf.c",
"src/math/powf_data.c",
"src/math/powl.c",
"src/math/remainder.c",
"src/math/remainderf.c",
Expand Down Expand Up @@ -320,6 +338,7 @@ static_library("c_internal") {
"src/math/sinhl.c",
"src/math/sinl.c",
"src/math/sqrt.c",
"src/math/sqrt_data.c",
"src/math/sqrtf.c",
"src/math/sqrtl.c",
"src/math/tan.c",
Expand Down Expand Up @@ -393,6 +412,7 @@ static_library("c_internal") {
"src/stdlib/labs.c",
"src/stdlib/llabs.c",
"src/stdlib/qsort.c",
"src/stdlib/qsort_nr.c",
"src/stdlib/strtod.c",
"src/stdlib/strtol.c",
"src/stdlib/wcstod.c",
Expand Down Expand Up @@ -477,14 +497,6 @@ static_library("c_internal") {
sources += [
"src/fenv/$musl_arch/fenv-hf.S",
"src/fenv/$musl_arch/fenv.c",
"src/setjmp/$musl_arch/longjmp.s",
"src/setjmp/$musl_arch/setjmp.s",
]
}
if (musl_arch == "mips") {
sources += [
"src/fenv/$musl_arch/fenv-sf.c",
"src/fenv/$musl_arch/fenv.S",
"src/setjmp/$musl_arch/longjmp.S",
"src/setjmp/$musl_arch/setjmp.S",
]
Expand Down
33 changes: 23 additions & 10 deletions third_party/musl/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
musl as a whole is licensed under the following standard MIT license:

----------------------------------------------------------------------
Copyright © 2005-2014 Rich Felker, et al.
Copyright © 2005-2020 Rich Felker, et al.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -26,12 +26,17 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Authors/contributors include:

A. Wilcox
Ada Worcester
Alex Dowad
Alex Suykov
Alexander Monakov
Andre McCurdy
Andrew Kelley
Anthony G. Basile
Aric Belsito
Arvid Picciani
Bartosz Brachaczek
Benjamin Peterson
Bobby Bingham
Boris Brezillon
Brent Cook
Expand All @@ -40,11 +45,14 @@ Clément Vasseur
Daniel Micay
Daniel Sabogal
Daurnimator
David Carlier
David Edelsohn
Denys Vlasenko
Dmitry Ivanov
Dmitry V. Levin
Drew DeVault
Emil Renner Berthing
Fangrui Song
Felix Fietkau
Felix Janda
Gianluca Anzolin
Expand All @@ -58,38 +66,45 @@ Jeremy Huntwork
Jo-Philipp Wich
Joakim Sindholt
John Spencer
Josiah Worcester
Julien Ramseier
Justin Cormack
Kaarle Ritvanen
Khem Raj
Kylie McClain
Leah Neukirchen
Luca Barbato
Luka Perkov
M Farkas-Dyck (Strake)
Mahesh Bodapati
Markus Wichmann
Masanori Ogino
Michael Clark
Michael Forney
Mikhail Kremnyov
Natanael Copa
Nicholas J. Kain
orc
Pascal Cuoq
Patrick Oppenlander
Petr Hosek
Petr Skocik
Pierre Carrier
Reini Urban
Rich Felker
Richard Pennington
Ryan Fairfax
Samuel Holland
Segev Finer
Shiz
sin
Solar Designer
Stefan Kristiansson
Stefan O'Rear
Szabolcs Nagy
Timo Teräs
Trutz Behn
Valentin Ochs
Will Dietz
William Haddon
William Pitcock

Expand All @@ -107,14 +122,18 @@ Copyright © 1993,2004 Sun Microsystems or
Copyright © 2003-2011 David Schultz or
Copyright © 2003-2009 Steven G. Kargl or
Copyright © 2003-2009 Bruce D. Evans or
Copyright © 2008 Stephen L. Moshier
Copyright © 2008 Stephen L. Moshier or
Copyright © 2017-2018 Arm Limited
and labelled as such in comments in the individual source files. All
have been licensed under extremely permissive terms.

The ARM memcpy code (src/string/arm/memcpy_el.S) is Copyright © 2008
The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008
The Android Open Source Project and is licensed under a two-clause BSD
license. It was taken from Bionic libc, used on Android.

The AArch64 memcpy and memset code (src/string/aarch64/*) are
Copyright © 1999-2019, Arm Limited.

The implementation of DES for crypt (src/crypt/crypt_des.c) is
Copyright © 1994 David Burren. It is licensed under a BSD license.

Expand All @@ -126,12 +145,6 @@ in jurisdictions that may not recognize the public domain.
The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
Valentin Ochs and is licensed under an MIT-style license.

The BSD PRNG implementation (src/prng/random.c) and XSI search API
(src/search/*.c) functions are Copyright © 2011 Szabolcs Nagy and
licensed under following terms: "Permission to use, copy, modify,
and/or distribute this code for any purpose with or without fee is
hereby granted. There is no warranty."

The x86_64 port was written by Nicholas J. Kain and is licensed under
the standard MIT terms.

Expand Down
12 changes: 9 additions & 3 deletions third_party/musl/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@ and ABI combinations:
* Little-endian default; big-endian variants also supported

* MIPS
* ABI is o32
* ABI is o32, fp32/fpxx (except on r6 which is fp64)
* Big-endian default; little-endian variants also supported
* Default ABI variant uses FPU registers; alternate soft-float ABI
that does not use FPU registers or instructions is available
* MIPS2 or later, or kernel emulation of ll/sc (standard in Linux)
is required
* MIPS32r6, an incompatible ISA, is supported as a variant "mipsr6"

* MIPS64
* ABI is n64 (LP64)
* ABI is n64 (LP64) or n32 (ILP32)
* Big-endian default; little-endian variants also supported
* Default ABI variant uses FPU registers; alternate soft-float ABI
that does not use FPU registers or instructions is available
Expand All @@ -85,7 +86,7 @@ and ABI combinations:

* SuperH (SH)
* Standard ELF ABI or FDPIC ABI (shared-text without MMU)
* Little-endian by default; big-engian variant also supported
* Little-endian by default; big-endian variant also supported
* Full FPU ABI or soft-float ABI is supported, but the
single-precision-only FPU ABI is not

Expand All @@ -96,6 +97,11 @@ and ABI combinations:

* OpenRISC 1000 (or1k)

* RISC-V 64
* Little endian
* Hard, soft, and hard-single/soft-double floating point ABIs
* Standard ELF; no shared-text NOMMU support



Build and Installation Procedure
Expand Down
14 changes: 4 additions & 10 deletions third_party/musl/METADATA
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,15 @@ description:
"Subtree at third_party/musl."

third_party {
url {
type: LOCAL_SOURCE
value: "/third_party/musl_mirror"
}
url {
type: GIT
value: "git://git.musl-libc.org/musl"
}
version: "0fa1e638e87cf257e9f96b4019b2076afd674a19"
version: "f5f55d6589940fd2c2188d76686efe3a530e64e0"
last_upgrade_date {
year: 2018
month: 9
day: 4
year: 2023
month: 5
day: 1
}
license_type: NOTICE
local_modifications:
'11/30/21 - Added BUILD.gn file as part of GN migration.'
}
8 changes: 5 additions & 3 deletions third_party/musl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ includedir = $(prefix)/include
libdir = $(prefix)/lib
syslibdir = /lib

SRC_DIRS = $(addprefix $(srcdir)/,src/* crt ldso)
MALLOC_DIR = mallocng
SRC_DIRS = $(addprefix $(srcdir)/,src/* src/malloc/$(MALLOC_DIR) crt ldso $(COMPAT_SRC_DIRS))
BASE_GLOBS = $(addsuffix /*.c,$(SRC_DIRS))
ARCH_GLOBS = $(addsuffix /$(ARCH)/*.[csS],$(SRC_DIRS))
BASE_SRCS = $(sort $(wildcard $(BASE_GLOBS)))
Expand All @@ -27,7 +28,7 @@ ARCH_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(ARCH_SRCS)))
REPLACED_OBJS = $(sort $(subst /$(ARCH)/,/,$(ARCH_OBJS)))
ALL_OBJS = $(addprefix obj/, $(filter-out $(REPLACED_OBJS), $(sort $(BASE_OBJS) $(ARCH_OBJS))))

LIBC_OBJS = $(filter obj/src/%,$(ALL_OBJS))
LIBC_OBJS = $(filter obj/src/%,$(ALL_OBJS)) $(filter obj/compat/%,$(ALL_OBJS))
LDSO_OBJS = $(filter obj/ldso/%,$(ALL_OBJS:%.o=%.lo))
CRT_OBJS = $(filter obj/crt/%,$(ALL_OBJS))

Expand All @@ -46,7 +47,7 @@ CFLAGS_AUTO = -Os -pipe
CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc

CFLAGS_ALL = $(CFLAGS_C99FSE)
CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include
CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/include -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include
CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS)

LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS)
Expand Down Expand Up @@ -75,6 +76,7 @@ WRAPCC_CLANG = clang
LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH)$(SUBARCH).so.1

-include config.mak
-include $(srcdir)/arch/$(ARCH)/arch.mak

ifeq ($(ARCH),)

Expand Down
2 changes: 1 addition & 1 deletion third_party/musl/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.20
1.2.4
Loading

0 comments on commit 9d71f6c

Please sign in to comment.