Merge "linker: Fallback to argv[0] to get the executable info"
diff --git a/libc/arch-arm64/dynamic_function_dispatch.cpp b/libc/arch-arm64/dynamic_function_dispatch.cpp
index bbd4218..0edc7f7 100644
--- a/libc/arch-arm64/dynamic_function_dispatch.cpp
+++ b/libc/arch-arm64/dynamic_function_dispatch.cpp
@@ -61,11 +61,8 @@
typedef int stpcpy_func(char*, const char*);
DEFINE_IFUNC_FOR(stpcpy) {
- if (arg->_hwcap2 & HWCAP2_MTE) {
- RETURN_FUNC(stpcpy_func, __stpcpy_aarch64_mte);
- } else {
- RETURN_FUNC(stpcpy_func, __stpcpy_aarch64);
- }
+ // TODO: enable the SVE version.
+ RETURN_FUNC(stpcpy_func, __stpcpy_aarch64);
}
typedef char* strchr_func(const char*, int);
@@ -88,20 +85,14 @@
typedef int strcmp_func(const char*, const char*);
DEFINE_IFUNC_FOR(strcmp) {
- if (arg->_hwcap2 & HWCAP2_MTE) {
- RETURN_FUNC(strcmp_func, __strcmp_aarch64_mte);
- } else {
- RETURN_FUNC(strcmp_func, __strcmp_aarch64);
- }
+ // TODO: enable the SVE version.
+ RETURN_FUNC(strcmp_func, __strcmp_aarch64);
}
typedef int strcpy_func(char*, const char*);
DEFINE_IFUNC_FOR(strcpy) {
- if (arg->_hwcap2 & HWCAP2_MTE) {
- RETURN_FUNC(strcpy_func, __strcpy_aarch64_mte);
- } else {
- RETURN_FUNC(strcpy_func, __strcpy_aarch64);
- }
+ // TODO: enable the SVE version.
+ RETURN_FUNC(strcpy_func, __strcpy_aarch64);
}
typedef size_t strlen_func(const char*);
@@ -115,11 +106,8 @@
typedef int strncmp_func(const char*, const char*, int);
DEFINE_IFUNC_FOR(strncmp) {
- if (arg->_hwcap2 & HWCAP2_MTE) {
- RETURN_FUNC(strncmp_func, __strncmp_aarch64_mte);
- } else {
- RETURN_FUNC(strncmp_func, __strncmp_aarch64);
- }
+ // TODO: enable the SVE version.
+ RETURN_FUNC(strncmp_func, __strncmp_aarch64);
}
typedef char* strrchr_func(const char*, int);
diff --git a/libc/arch-arm64/static_function_dispatch.S b/libc/arch-arm64/static_function_dispatch.S
index d00f071..5c36de6 100644
--- a/libc/arch-arm64/static_function_dispatch.S
+++ b/libc/arch-arm64/static_function_dispatch.S
@@ -36,13 +36,13 @@
FUNCTION_DELEGATE(memchr, __memchr_aarch64_mte)
FUNCTION_DELEGATE(memcpy, __memcpy_aarch64)
FUNCTION_DELEGATE(memmove, __memmove_aarch64)
-FUNCTION_DELEGATE(stpcpy, __stpcpy_aarch64_mte)
+FUNCTION_DELEGATE(stpcpy, __stpcpy_aarch64)
FUNCTION_DELEGATE(strchr, __strchr_aarch64_mte)
FUNCTION_DELEGATE(strchrnul, __strchrnul_aarch64_mte)
-FUNCTION_DELEGATE(strcmp, __strcmp_aarch64_mte)
-FUNCTION_DELEGATE(strcpy, __strcpy_aarch64_mte)
+FUNCTION_DELEGATE(strcmp, __strcmp_aarch64)
+FUNCTION_DELEGATE(strcpy, __strcpy_aarch64)
FUNCTION_DELEGATE(strlen, __strlen_aarch64_mte)
FUNCTION_DELEGATE(strrchr, __strrchr_aarch64_mte)
-FUNCTION_DELEGATE(strncmp, __strncmp_aarch64_mte)
+FUNCTION_DELEGATE(strncmp, __strncmp_aarch64)
NOTE_GNU_PROPERTY()
diff --git a/libc/include/utmp.h b/libc/include/utmp.h
index cb72ce2..7aa5718 100644
--- a/libc/include/utmp.h
+++ b/libc/include/utmp.h
@@ -99,7 +99,7 @@
/**
* Does nothing.
*/
-int utmpname(const char* __path);
+int utmpname(const char* _Nonnull __path);
/**
* Does nothing.
*/
@@ -107,11 +107,11 @@
/**
* Does nothing.
*/
-struct utmp* getutent(void);
+struct utmp* _Nullable getutent(void);
/**
* Does nothing.
*/
-struct utmp* pututline(const struct utmp* __entry);
+struct utmp* _Nullable pututline(const struct utmp* _Nonnull __entry);
/**
* Does nothing.
*/
diff --git a/tests/utmp_test.cpp b/tests/utmp_test.cpp
index 6d0d6f1..b024818 100644
--- a/tests/utmp_test.cpp
+++ b/tests/utmp_test.cpp
@@ -29,5 +29,6 @@
setutent();
ASSERT_EQ(NULL, getutent());
endutent();
- ASSERT_EQ(NULL, pututline(NULL));
+ utmp failure = {.ut_type = EMPTY};
+ ASSERT_EQ(NULL, pututline(&failure));
}