Skip to content

Commit f1266df

Browse files
authored
fix: musl fixes (#5)
* fix: temp patch to include the lookup for pagehole in acestors patch From checkpoint-restore/criu#2747 * chore: reconfigure packages and download kernel packages from the correct sources * chore: avoid downloading the musl license This is done to avoid that the build fails when the musl website goes down.
1 parent 4c3cd19 commit f1266df

File tree

11 files changed

+225
-29
lines changed

11 files changed

+225
-29
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ RUN apk add cmake \
2222
patch \
2323
coreutils \
2424
gettext \
25-
gettext-dev
25+
gettext-dev \
26+
gtk-doc
2627

2728
RUN apk add sudo
2829
RUN adduser -D -u $USER_UID -g $USER_GID $USERNAME \

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ ExternalProject_Add(criu
9494
URL ${DEP_criu_URL}
9595
URL_HASH SHA256=${DEP_criu_SHA256}
9696
UPDATE_DISCONNECTED 1
97-
PATCH_COMMAND patch -p1 -i ${CMAKE_SOURCE_DIR}/patch/criu-build.patch && patch -p1 -i ${CMAKE_SOURCE_DIR}/patch/criu-static-plugin.patch
97+
PATCH_COMMAND patch -p1 -i ${CMAKE_SOURCE_DIR}/patch/criu-build.patch && patch -p1 -i ${CMAKE_SOURCE_DIR}/patch/criu-static-plugin.patch && patch -p1 -i ${CMAKE_SOURCE_DIR}/patch/pagehole-fix.patch
9898
CONFIGURE_COMMAND ""
9999
DOWNLOAD_DIR ${SOURCE_DOWNLOADS_DIR}
100100
DOWNLOAD_NAME ${DEP_criu_FILENAME}

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ RUN apk add cmake \
1717
patch \
1818
coreutils \
1919
gettext \
20-
gettext-dev
20+
gettext-dev \
21+
gtk-doc
2122

2223

2324
RUN mkdir /source

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ this repository will include the musl license in case the main compiler used to
3434

3535
```bash
3636
apk update
37-
apk add cmake make clang llvm git autoconf automake libtool m4 flex bison pkgconfig bash linux-headers patch coreutils gettext gettext-dev
37+
apk add cmake make clang llvm git autoconf automake libtool m4 flex bison pkgconfig bash linux-headers patch coreutils gettext gettext-dev gtk-doc
3838
```
3939

4040
### Configure

check_musl.cmake

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,14 @@ function(fetch_musl_license_if_needed)
2929
if(CMAKE_IS_USING_MUSL)
3030
message(STATUS "musl libc detected, configuring license installation.")
3131

32-
set(MUSL_LICENSE_URL "https://git.musl-libc.org/cgit/musl/plain/COPYRIGHT")
33-
set(DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/musl.COPYRIGHT")
34-
install(FILES ${DOWNLOAD_LOCATION} DESTINATION ${CMAKE_INSTALL_DOCDIR}/third_party RENAME musl.COPYRIGHT)
32+
set(LOCAL_MUSL_LICENSE "${CMAKE_SOURCE_DIR}/musl.COPYRIGHT")
3533

36-
if (NOT EXISTS ${DOWNLOAD_LOCATION})
37-
message(STATUS "Downloading musl license from ${MUSL_LICENSE_URL} to ${DOWNLOAD_LOCATION}.")
34+
if(EXISTS ${LOCAL_MUSL_LICENSE})
35+
install(FILES ${LOCAL_MUSL_LICENSE} DESTINATION share/doc/fusion-snapshot)
36+
message(STATUS "Using local musl license from ${LOCAL_MUSL_LICENSE}")
3837
else()
39-
message(STATUS "musl license already exists at ${DOWNLOAD_LOCATION}, skipping download.")
40-
return()
38+
message(WARNING "musl libc detected but local musl.COPYRIGHT file not found at ${LOCAL_MUSL_LICENSE}")
4139
endif()
42-
43-
file(DOWNLOAD ${MUSL_LICENSE_URL} ${DOWNLOAD_LOCATION} SHOW_PROGRESS STATUS download_status)
44-
45-
46-
list(GET download_status 0 download_result)
47-
if(NOT download_result EQUAL 0)
48-
list(GET download_status 1 error_msg)
49-
message(FATAL_ERROR "Failed to download musl license from ${MUSL_LICENSE_URL}. Error: ${error_msg}")
50-
endif()
51-
52-
message(STATUS "musl license downloaded successfully.")
5340
else()
5441
message(STATUS "musl libc not detected. Skipping license installation.")
5542
endif()

dependencies/Libcap.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ endif()
2727

2828
register_dependency(
2929
libcap
30-
"https://git.kernel.org/pub/scm/libs/libcap/libcap.git/snapshot/libcap-2.70.tar.gz"
31-
"18f00ea97c7541af86379dec9d4d8ea838aac4a1f70177d81d91657e4e43b808"
30+
"https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.70.tar.gz"
31+
"d3b777ed413c9fafface03b917e171854709b5e4be38dbfb9219aaf7dfd4eea6"
3232
"License"
3333
)
3434

dependencies/Libintl.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ ExternalProject_Add(gettext
3131
UPDATE_DISCONNECTED 1
3232
DOWNLOAD_DIR ${SOURCE_DOWNLOADS_DIR}
3333
DOWNLOAD_NAME ${DEP_gettext_FILENAME}
34-
CONFIGURE_COMMAND <SOURCE_DIR>/configure
34+
UPDATE_COMMAND autoreconf -fiv
35+
CONFIGURE_COMMAND <SOURCE_DIR>/configure
3536
--prefix=${LIBINTL_INSTALL_DIR}
3637
--disable-shared
3738
--enable-static

dependencies/ProtobufC.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ExternalProject_Add(protobuf-c
3636
UPDATE_DISCONNECTED 1
3737
DOWNLOAD_DIR ${SOURCE_DOWNLOADS_DIR}
3838
DOWNLOAD_NAME ${DEP_protobuf-c_FILENAME}
39-
UPDATE_COMMAND sh -c "test -f <SOURCE_DIR>/configure || <SOURCE_DIR>/autogen.sh"
39+
UPDATE_COMMAND autoreconf -fiv
4040
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env
4141
"protobuf_CFLAGS=$<TARGET_PROPERTY:protobuf::static,CONSUMER_CFLAGS>"
4242
"protobuf_LIBS=$<TARGET_PROPERTY:protobuf::static,CONSUMER_LDFLAGS>"

dependencies/UtilLinux.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ endif()
2222

2323
register_dependency(
2424
util_linux
25-
"https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/snapshot/util-linux-2.41.1.tar.gz"
26-
"61a9785cbf04091286ec2bbfb78e87c35e6380f084f38115a4677b90b9ad4437"
25+
"https://www.kernel.org/pub/linux/utils/util-linux/v2.41/util-linux-2.41.tar.gz"
26+
"c014b5861695b603d0be2ad1e6f10d5838b9d7859e1dd72d01504556817d8a87"
2727
"COPYING"
2828
)
2929

@@ -33,7 +33,7 @@ ExternalProject_Add(util_linux
3333
UPDATE_DISCONNECTED 1
3434
DOWNLOAD_DIR ${SOURCE_DOWNLOADS_DIR}
3535
DOWNLOAD_NAME ${DEP_util_linux_FILENAME}
36-
UPDATE_COMMAND sh -c "test -f <SOURCE_DIR>/configure || <SOURCE_DIR>/autogen.sh"
36+
UPDATE_COMMAND autoreconf -fiv
3737
CONFIGURE_COMMAND <SOURCE_DIR>/configure
3838
--enable-static
3939
--disable-shared

musl.COPYRIGHT

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
musl as a whole is licensed under the following standard MIT license:
2+
3+
----------------------------------------------------------------------
4+
Copyright © 2005-2020 Rich Felker, et al.
5+
6+
Permission is hereby granted, free of charge, to any person obtaining
7+
a copy of this software and associated documentation files (the
8+
"Software"), to deal in the Software without restriction, including
9+
without limitation the rights to use, copy, modify, merge, publish,
10+
distribute, sublicense, and/or sell copies of the Software, and to
11+
permit persons to whom the Software is furnished to do so, subject to
12+
the following conditions:
13+
14+
The above copyright notice and this permission notice shall be
15+
included in all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24+
----------------------------------------------------------------------
25+
26+
Authors/contributors include:
27+
28+
A. Wilcox
29+
Ada Worcester
30+
Alex Dowad
31+
Alex Suykov
32+
Alexander Monakov
33+
Andre McCurdy
34+
Andrew Kelley
35+
Anthony G. Basile
36+
Aric Belsito
37+
Arvid Picciani
38+
Bartosz Brachaczek
39+
Benjamin Peterson
40+
Bobby Bingham
41+
Boris Brezillon
42+
Brent Cook
43+
Chris Spiegel
44+
Clément Vasseur
45+
Daniel Micay
46+
Daniel Sabogal
47+
Daurnimator
48+
David Carlier
49+
David Edelsohn
50+
Denys Vlasenko
51+
Dmitry Ivanov
52+
Dmitry V. Levin
53+
Drew DeVault
54+
Emil Renner Berthing
55+
Fangrui Song
56+
Felix Fietkau
57+
Felix Janda
58+
Gianluca Anzolin
59+
Hauke Mehrtens
60+
He X
61+
Hiltjo Posthuma
62+
Isaac Dunham
63+
Jaydeep Patil
64+
Jens Gustedt
65+
Jeremy Huntwork
66+
Jo-Philipp Wich
67+
Joakim Sindholt
68+
John Spencer
69+
Julien Ramseier
70+
Justin Cormack
71+
Kaarle Ritvanen
72+
Khem Raj
73+
Kylie McClain
74+
Leah Neukirchen
75+
Luca Barbato
76+
Luka Perkov
77+
Lynn Ochs
78+
M Farkas-Dyck (Strake)
79+
Mahesh Bodapati
80+
Markus Wichmann
81+
Masanori Ogino
82+
Michael Clark
83+
Michael Forney
84+
Mikhail Kremnyov
85+
Natanael Copa
86+
Nicholas J. Kain
87+
orc
88+
Pascal Cuoq
89+
Patrick Oppenlander
90+
Petr Hosek
91+
Petr Skocik
92+
Pierre Carrier
93+
Reini Urban
94+
Rich Felker
95+
Richard Pennington
96+
Ryan Fairfax
97+
Samuel Holland
98+
Segev Finer
99+
Shiz
100+
sin
101+
Solar Designer
102+
Stefan Kristiansson
103+
Stefan O'Rear
104+
Szabolcs Nagy
105+
Timo Teräs
106+
Trutz Behn
107+
Will Dietz
108+
William Haddon
109+
William Pitcock
110+
111+
Portions of this software are derived from third-party works licensed
112+
under terms compatible with the above MIT license:
113+
114+
The TRE regular expression implementation (src/regex/reg* and
115+
src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
116+
under a 2-clause BSD license (license text in the source files). The
117+
included version has been heavily modified by Rich Felker in 2012, in
118+
the interests of size, simplicity, and namespace cleanliness.
119+
120+
Much of the math library code (src/math/* and src/complex/*) is
121+
Copyright © 1993,2004 Sun Microsystems or
122+
Copyright © 2003-2011 David Schultz or
123+
Copyright © 2003-2009 Steven G. Kargl or
124+
Copyright © 2003-2009 Bruce D. Evans or
125+
Copyright © 2008 Stephen L. Moshier or
126+
Copyright © 2017-2018 Arm Limited
127+
and labelled as such in comments in the individual source files. All
128+
have been licensed under extremely permissive terms.
129+
130+
The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008
131+
The Android Open Source Project and is licensed under a two-clause BSD
132+
license. It was taken from Bionic libc, used on Android.
133+
134+
The AArch64 memcpy and memset code (src/string/aarch64/*) are
135+
Copyright © 1999-2019, Arm Limited.
136+
137+
The implementation of DES for crypt (src/crypt/crypt_des.c) is
138+
Copyright © 1994 David Burren. It is licensed under a BSD license.
139+
140+
The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
141+
originally written by Solar Designer and placed into the public
142+
domain. The code also comes with a fallback permissive license for use
143+
in jurisdictions that may not recognize the public domain.
144+
145+
The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
146+
Lynn Ochs and is licensed under an MIT-style license.
147+
148+
The x86_64 port was written by Nicholas J. Kain and is licensed under
149+
the standard MIT terms.
150+
151+
The mips and microblaze ports were originally written by Richard
152+
Pennington for use in the ellcc project. The original code was adapted
153+
by Rich Felker for build system and code conventions during upstream
154+
integration. It is licensed under the standard MIT terms.
155+
156+
The mips64 port was contributed by Imagination Technologies and is
157+
licensed under the standard MIT terms.
158+
159+
The powerpc port was also originally written by Richard Pennington,
160+
and later supplemented and integrated by John Spencer. It is licensed
161+
under the standard MIT terms.
162+
163+
All other files which have no copyright comments are original works
164+
produced specifically for use as part of this library, written either
165+
by Rich Felker, the main author of the library, or by one or more
166+
contibutors listed above. Details on authorship of individual files
167+
can be found in the git version control history of the project. The
168+
omission of copyright and license comments in each file is in the
169+
interest of source tree size.
170+
171+
In addition, permission is hereby granted for all public header files
172+
(include/* and arch/*/bits/*) and crt files intended to be linked into
173+
applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
174+
the copyright notice and permission notice otherwise required by the
175+
license, and to use these files without any requirement of
176+
attribution. These files include substantial contributions from:
177+
178+
Bobby Bingham
179+
John Spencer
180+
Nicholas J. Kain
181+
Rich Felker
182+
Richard Pennington
183+
Stefan Kristiansson
184+
Szabolcs Nagy
185+
186+
all of whom have explicitly granted such permission.
187+
188+
This file previously contained text expressing a belief that most of
189+
the files covered by the above exception were sufficiently trivial not
190+
to be subject to copyright, resulting in confusion over whether it
191+
negated the permissions granted in the license. In the spirit of
192+
permissive licensing, and of not having licensing issues being an
193+
obstacle to adoption, that text has been removed.

0 commit comments

Comments
 (0)