aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-09-17 08:47:44 +0000
committerUlrich Drepper <drepper@redhat.com>2003-09-17 08:47:44 +0000
commita4db3439f1177cf5c5ceb80bfa3f3a2cef00fc0e (patch)
treee21a8cd5a2222281888d37b530d360e92995abd7 /stdlib
parent6c052003bda07641309dcd4fe4a5158d24f5d607 (diff)
downloadglibc-a4db3439f1177cf5c5ceb80bfa3f3a2cef00fc0e.zip
glibc-a4db3439f1177cf5c5ceb80bfa3f3a2cef00fc0e.tar.gz
glibc-a4db3439f1177cf5c5ceb80bfa3f3a2cef00fc0e.tar.bz2
Update.
2003-09-15 Jakub Jelinek <jakub@redhat.com> * sysdeps/i386/Makefile (sysdep-CFLAGS): If not in math or csu subdir, add -mpreferred-stack-boundary=4, with few exceptions. 2003-09-17 Jakub Jelinek <jakub@redhat.com> * Makeconfig (stack-align-test-flags): Set. * stdlib/Makefile (CFLAGS-tst-bsearch.c): Add $(stack-align-test-flags). * stdlib/tst-bsearch.c: Include tst-stack-align.h. (align_check): New var. (comp): Use TEST_STACK_ALIGN macro. (do_test): Fail if align_check != 1. * sysdeps/generic/tst-stack-align.h: New file. * sysdeps/i386/i686/Makefile (stack-align-test-flags): Add -msse. * sysdeps/i386/i686/tst-stack-align.h: New file.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/Makefile2
-rw-r--r--stdlib/tst-bsearch.c18
2 files changed, 19 insertions, 1 deletions
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 5ff7dfd..f882a55 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -96,6 +96,8 @@ ifeq (yes,$(have-protected))
CFLAGS-atexit.c = -DHAVE_DOT_HIDDEN
endif
+CFLAGS-tst-bsearch.c = $(stack-align-test-flags)
+
include ../Rules
# Testdir has to be named stdlib and needs to be writable
diff --git a/stdlib/tst-bsearch.c b/stdlib/tst-bsearch.c
index ad80776..8d2fd89 100644
--- a/stdlib/tst-bsearch.c
+++ b/stdlib/tst-bsearch.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2000.
@@ -19,6 +19,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <tst-stack-align.h>
struct entry
{
@@ -40,6 +41,7 @@ struct entry
};
#define narr (sizeof (arr) / sizeof (arr[0]))
+static int align_check;
static int
comp (const void *p1, const void *p2)
@@ -47,6 +49,9 @@ comp (const void *p1, const void *p2)
struct entry *e1 = (struct entry *) p1;
struct entry *e2 = (struct entry *) p2;
+ if (!align_check)
+ align_check = TEST_STACK_ALIGN () ? -1 : 1;
+
return e1->val - e2->val;
}
@@ -128,6 +133,17 @@ main (void)
}
}
+ if (align_check == 0)
+ {
+ puts ("alignment not checked");
+ result = 1;
+ }
+ else if (align_check == -1)
+ {
+ puts ("stack not sufficiently aligned");
+ result = 1;
+ }
+
if (result == 0)
puts ("all OK");