aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-12-23 05:11:58 +0800
committerH.J. Lu <hjl.tools@gmail.com>2024-12-23 06:28:55 +0800
commita2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a (patch)
tree7816983cdeea6e6c32dd005c76da785811ea3047 /misc
parent3fb895ac88e99201573352b1abc18db4340ecede (diff)
downloadglibc-a2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a.zip
glibc-a2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a.tar.gz
glibc-a2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a.tar.bz2
include/sys/cdefs.h: Add __attribute_optimization_barrier__
Add __attribute_optimization_barrier__ to disable inlining and cloning on a function. For Clang, expand it to __attribute__ ((optnone)) Otherwise, expand it to __attribute__ ((noinline, clone)) Co-Authored-By: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'misc')
-rw-r--r--misc/tst-syscalls.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/misc/tst-syscalls.c b/misc/tst-syscalls.c
index d060b12..ac1e101 100644
--- a/misc/tst-syscalls.c
+++ b/misc/tst-syscalls.c
@@ -37,7 +37,7 @@ struct Array
static int error_count;
-__attribute__ ((noclone, noinline))
+__attribute_optimization_barrier__
struct Array
allocate (size_t bytes)
{
@@ -52,7 +52,7 @@ allocate (size_t bytes)
return __extension__ (struct Array) {bytes, p};
}
-__attribute__ ((noclone, noinline))
+__attribute_optimization_barrier__
void
deallocate (struct Array b)
{
@@ -66,7 +66,7 @@ deallocate (struct Array b)
}
}
-__attribute__ ((noclone, noinline))
+__attribute_optimization_barrier__
void *
do_mmap (void *addr, size_t length)
{
@@ -74,7 +74,7 @@ do_mmap (void *addr, size_t length)
MAP_PRIVATE | MAP_ANON, -1, 0);
}
-__attribute__ ((noclone, noinline))
+__attribute_optimization_barrier__
void *
reallocate (struct Array b)
{
@@ -86,7 +86,7 @@ reallocate (struct Array b)
return NULL;
}
-__attribute__ ((noclone, noinline))
+__attribute_optimization_barrier__
void
protect (struct Array b)
{
@@ -104,7 +104,7 @@ protect (struct Array b)
}
}
-__attribute__ ((noclone, noinline))
+__attribute_optimization_barrier__
ssize_t
do_read (int fd, void *ptr, struct Array b)
{
@@ -116,7 +116,7 @@ do_read (int fd, void *ptr, struct Array b)
return 0;
}
-__attribute__ ((noclone, noinline))
+__attribute_optimization_barrier__
ssize_t
do_write (int fd, void *ptr, struct Array b)
{