about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-07-24 01:10:01 -0400
committerRich Felker <dalias@aerifal.cx>2011-07-24 01:10:01 -0400
commite91c375fd027a485bd7415afbaf059d429e11e11 (patch)
treec8692219599705f2ee496c4f384443074903e4bb
parent6ab444d97a00fd8d04264cefef0291d3c7b5b701 (diff)
downloadmusl-e91c375fd027a485bd7415afbaf059d429e11e11.tar.gz
musl-e91c375fd027a485bd7415afbaf059d429e11e11.tar.xz
musl-e91c375fd027a485bd7415afbaf059d429e11e11.zip
workaround for gcc's optimizer breaking dynamic symbol resolution
-rw-r--r--src/time/clock_gettime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/time/clock_gettime.c b/src/time/clock_gettime.c
index bb977e28..9fef54a4 100644
--- a/src/time/clock_gettime.c
+++ b/src/time/clock_gettime.c
@@ -5,7 +5,7 @@
 #include "libc.h"
 
 int __vdso_clock_gettime(clockid_t, struct timespec *) __attribute__((weak));
-static int (*const cgt)(clockid_t, struct timespec *) = __vdso_clock_gettime;
+static int (*cgt)(clockid_t, struct timespec *) = __vdso_clock_gettime;
 
 int __clock_gettime(clockid_t clk, struct timespec *ts)
 {
@@ -14,6 +14,7 @@ int __clock_gettime(clockid_t clk, struct timespec *ts)
 	r = __syscall(SYS_clock_gettime, clk, ts);
 	if (!r) return r;
 	if (r == -ENOSYS) {
+		cgt = 0;
 		if (clk == CLOCK_REALTIME) {
 			__syscall(SYS_gettimeofday, clk, ts, 0);
 			ts->tv_nsec = (int)ts->tv_nsec * 1000;