aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAugustin Cavalier <waddlesplash@gmail.com>2016-08-13 11:16:06 -0400
committerAugustin Cavalier <waddlesplash@gmail.com>2016-08-13 11:16:06 -0400
commit4fecb09f143c2d213b989af691a0d1b3ed6c1aec (patch)
treeece6b968c41bbc7e4101af6e6e94a8f5c4ff682d
parent2fd8e2811ac0ccb2b4df9f524a1e1f17b8e58a97 (diff)
libroot: Ship empty libpthread.a and libm.a for POSIX and general compatibility.hrev50486
A few weeks back, I spotted in the Musl FAQ that they apparently ship empty libm.a and libpthread.a files (https://www.musl-libc.org/faq.html), which they said was for POSIX compatibility. A bit of digging got me to http://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html which says: > It is unspecified whether the libraries libc.a, libl.a, libm.a, libpthread.a, > librt.a, [OB] [Option Start] libtrace.a, [Option End] libxnet.a, or liby.a > exist as regular files. The implementation may accept as -l option-arguments > names of objects that do not exist as regular files. So to follow the letter of the law, we only need to have the "c99" command accept these; however, it appears all Linux and BSD cstdlibs accept them no matter what compliance mode is in effect. Discussed with PulkoMandy. This will make HaikuPorts' job a lot easier...
-rw-r--r--build/jam/packages/HaikuDevel8
-rw-r--r--build/jam/packages/HaikuDevelSecondary7
-rw-r--r--src/system/libroot/Jamfile3
-rw-r--r--src/system/libroot/empty.c2
4 files changed, 16 insertions, 4 deletions
diff --git a/build/jam/packages/HaikuDevel b/build/jam/packages/HaikuDevel
index 8ecf66efe8..bc4f2832f6 100644
--- a/build/jam/packages/HaikuDevel
+++ b/build/jam/packages/HaikuDevel
@@ -38,8 +38,12 @@ for lib in [ HaikuImageGetSystemLibs ] $(developmentLibs) {
}
# static libraries
-AddFilesToPackage develop lib : libcolumnlistview.a
- <$(architecture)>liblocalestub.a <$(architecture)>libshared.a ;
+AddFilesToPackage develop lib :
+ libcolumnlistview.a
+ <$(architecture)>liblocalestub.a
+ libm.a
+ libpthread.a
+ <$(architecture)>libshared.a ;
# the POSIX error code mapper library
AddFilesToPackage develop lib : libposix_error_mapper.a ;
diff --git a/build/jam/packages/HaikuDevelSecondary b/build/jam/packages/HaikuDevelSecondary
index 6ee894b554..f0132c94e0 100644
--- a/build/jam/packages/HaikuDevelSecondary
+++ b/build/jam/packages/HaikuDevelSecondary
@@ -33,8 +33,11 @@ for lib in [ HaikuImageGetSystemLibs ] $(developmentLibs) {
}
# static libraries
-AddFilesToPackage develop lib $(architecture)
- : <$(architecture)>libcolumnlistview.a <$(architecture)>liblocalestub.a
+AddFilesToPackage develop lib $(architecture) :
+ <$(architecture)>libcolumnlistview.a
+ <$(architecture)>liblocalestub.a
+ <$(architecture)>libm.a
+ <$(architecture)>libpthread.a
<$(architecture)>libshared.a ;
# the POSIX error code mapper library
diff --git a/src/system/libroot/Jamfile b/src/system/libroot/Jamfile
index b9d962207f..2d988cd434 100644
--- a/src/system/libroot/Jamfile
+++ b/src/system/libroot/Jamfile
@@ -100,6 +100,9 @@ for architectureObject in [ MultiArchSubDirSetup ] {
[ TargetStaticLibsupc++ ]
[ TargetLibgcc ]
;
+
+ StaticLibrary [ MultiArchDefaultGristFiles libm.a ] : empty.c ;
+ StaticLibrary [ MultiArchDefaultGristFiles libpthread.a ] : empty.c ;
# Copy libroot.so and update the copy's revision section. We link
# everything against the original, but the copy will end up on the disk
diff --git a/src/system/libroot/empty.c b/src/system/libroot/empty.c
new file mode 100644
index 0000000000..f19e63d54d
--- /dev/null
+++ b/src/system/libroot/empty.c
@@ -0,0 +1,2 @@
+/* This file left intentionally empty, and is only here to get Jam to generate
+ * an actual static library. */