aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makeconfig11
-rw-r--r--Makerules12
-rw-r--r--elf/sotruss-lib.c4
3 files changed, 21 insertions, 6 deletions
diff --git a/Makeconfig b/Makeconfig
index 775bf12..507f4d4 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -866,6 +866,13 @@ endif
# -fno-math-errno.
+extra-math-flags = $(if $(filter libm,$(in-module)),-fno-math-errno,-fmath-errno)
+# Use 64 bit time_t support for installed programs
+installed-modules = nonlib nscd lddlibc4 libresolv ldconfig locale_programs \
+ iconvprogs libnss_files libnss_compat libnss_db libnss_hesiod \
+ libutil libpcprofile libSegFault
++extra-time-flags = $(if $(filter $(installed-modules),\
+ $(in-module)),-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64)
+
# We might want to compile with some stack-protection flag.
ifneq ($(stack-protector),)
+stack-protector=$(stack-protector)
@@ -963,7 +970,7 @@ libio-include = -I$(..)libio
built-modules = iconvprogs iconvdata ldconfig lddlibc4 libmemusage \
libSegFault libpcprofile librpcsvc locale-programs \
memusagestat nonlib nscd extramodules libnldbl libsupport \
- testsuite
+ testsuite testsuite-internal
in-module = $(subst -,_,$(firstword $(libof-$(basename $(@F))) \
$(libof-$(<F)) \
@@ -1003,7 +1010,7 @@ endif
override CFLAGS = -std=gnu11 -fgnu89-inline $(config-extra-cflags) \
$(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
- $(+extra-math-flags) \
+ $(+extra-math-flags) $(+extra-time-flags) \
$(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
$(CFLAGS-$(@F)) $(tls-model) \
$(foreach lib,$(libof-$(basename $(@F))) \
diff --git a/Makerules b/Makerules
index 8db0ca1..a4a3a12 100644
--- a/Makerules
+++ b/Makerules
@@ -1251,14 +1251,22 @@ lib := testsuite
include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
endif
-all-nonlib := $(strip $(tests-internal) $(test-internal-extras) \
- $(others) $(others-extras))
+all-nonlib := $(strip $(others) $(others-extras))
ifneq (,$(all-nonlib))
cpp-srcs-left = $(all-nonlib)
lib := nonlib
include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
endif
+# All internal tests use testsuite-internal module since for 64 bit time
+# support is set as default for MODULE_NAME=nonlib (which include some
+# installed programs).
+all-testsuite-internal := $(strip $(tests-internal) $(test-internal-extras))
+ifneq (,$(all-testsuite-internal))
+cpp-srcs-left = $(all-testsuite-internal)
+lib := testsuite-internal
+include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
+endif
ifeq ($(build-shared),yes)
# Generate normalized lists of symbols, versions, and data sizes.
diff --git a/elf/sotruss-lib.c b/elf/sotruss-lib.c
index 934ae52..f69d238 100644
--- a/elf/sotruss-lib.c
+++ b/elf/sotruss-lib.c
@@ -89,7 +89,7 @@ init (void)
if (which_process == NULL || which_process[0] == '\0')
snprintf (endp, 13, ".%ld", (long int) pid);
- out_fd = open (fullname, O_RDWR | O_CREAT | O_TRUNC, 0666);
+ out_fd = open64 (fullname, O_RDWR | O_CREAT | O_TRUNC, 0666);
if (out_fd != -1)
print_pid = 0;
}
@@ -102,7 +102,7 @@ init (void)
program. */
if (out_fd == -1)
{
- out_fd = fcntl (STDERR_FILENO, F_DUPFD, 1000);
+ out_fd = fcntl64 (STDERR_FILENO, F_DUPFD, 1000);
if (out_fd == -1)
out_fd = dup (STDERR_FILENO);
}