summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-01-26 21:50:18 (GMT)
committerAlexey Neyman <stilor@att.net>2017-01-26 21:50:18 (GMT)
commitd7b043e360dbf261ddb97accf5c454d3cf88f92e (patch)
tree80adb198f805f8c2b8057dc12c03dd557a5062af
parent675f7bfa4eb8415d5695dcda6111d9bd54419b0f (diff)
Create <sgidefs.h> if MUSL doesn't create one
Document the status quo and work around for mips-musl. Signed-off-by: Alexey Neyman <stilor@att.net>
-rw-r--r--scripts/build/arch.sh5
-rw-r--r--scripts/build/arch/mips.sh19
-rw-r--r--scripts/build/libc/musl.sh3
3 files changed, 27 insertions, 0 deletions
diff --git a/scripts/build/arch.sh b/scripts/build/arch.sh
index 3d3611b..75d3e21 100644
--- a/scripts/build/arch.sh
+++ b/scripts/build/arch.sh
@@ -64,5 +64,10 @@ CT_DoArchMUSLHeaderDir() {
:;
}
+# MUSL: Perform any final adjustments on the installed libc/headers
+CT_DoArchMUSLPostInstall() {
+ :;
+}
+
# Override from the actual arch implementation as needed.
. "${CT_LIB_DIR}/scripts/build/arch/${CT_ARCH}.sh"
diff --git a/scripts/build/arch/mips.sh b/scripts/build/arch/mips.sh
index 6097c89..f91a80a 100644
--- a/scripts/build/arch/mips.sh
+++ b/scripts/build/arch/mips.sh
@@ -69,3 +69,22 @@ CT_DoArchUClibcCflags() {
esac
done
}
+
+CT_DoArchMUSLPostInstall() {
+ # GDB and MUSL maintainers seem to disagree on whether <sgidefs.h>
+ # is to be provided as a part of C library. GDB guys think it is
+ # a C library responsibility, while MUSL authors think GDB should
+ # not be using <sgidefs.h>. Neither side is willing to reach out
+ # to the other and negotiate the needed changes, and I don't want
+ # to play the middle man. Hence, provide our own wrapper for
+ # for <sgidefs.h> - the only solution short of telling MUSL users
+ # stop using it. This is why MUSL is experimental in ct-ng and
+ # will likely remain in that status.
+ # References:
+ # http://www.openwall.com/lists/musl/2017/01/26/2
+ # https://sourceware.org/ml/gdb-patches/2017-01/msg00469.html
+ # https://www.sourceware.org/ml/libc-alpha/2004-11/msg00034.html
+ if [ ! -r "${CT_HEADERS_DIR}/sgidefs.h" ]; then
+ echo "#include <asm/sgidefs.h> // Redirected by ct-ng" > "${CT_HEADERS_DIR}/sgidefs.h"
+ fi
+}
diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh
index 9bbd95a..4ccb84c 100644
--- a/scripts/build/libc/musl.sh
+++ b/scripts/build/libc/musl.sh
@@ -154,6 +154,9 @@ do_libc_backend_once() {
;;
esac
done
+
+ # Any additional actions for this architecture
+ CT_DoArchMUSLPostInstall
fi
CT_EndStep