Skip to content

Commit 1d9ef30

Browse files
committed
ppc64le-linux-gnu: Skip testing *printf functions
Ubuntu 26.04 transitioned PowerPC64LE from the IBM long double format to IEEE binary128 [1], which mean a handful of variadic functions needed to switch to a binary128-compatible version. These were available starting with glibc 2.32 (2020-08) per the abilist [2], which is quite a bit newer than what we say we support at [3] (2.17, 2012-12). This explains test failures, so skip checking the functions per now. We should migrate to the `__<name>ieee128` functions at some point, which need not be related to our documented minimum, but there is no reason to do it now since Rust doesn't even stably support either IBM `long double` or binary128. Demo on Ubuntu 24.04: $ cat demo.c #include <stdio.h> #include <syslog.h> void demo() { char buf1[20] = { 0 }; char buf2[20] = { 0 }; printf("Hello, world! %d\n", 1); fprintf(stderr, "Hello, world! %d\n", 2); sprintf(buf1, "Hello, world! %d\n", 3); snprintf(buf2, 20, "Hello, world! %d\n", 4); syslog(0, "Hello, world! %d\n", 5); } $ powerpc64le-linux-gnu-gcc demo.c -c $ powerpc64le-linux-gnu-nm demo.o U .TOC. U __stack_chk_fail 0000000000000000 T demo U fprintf U printf U snprintf U sprintf U stderr U syslog And the same demo on Ubuntu 26.04: $ cat demo.c #include <stdio.h> #include <syslog.h> void demo() { char buf1[20] = { 0 }; char buf2[20] = { 0 }; printf("Hello, world! %d\n", 1); fprintf(stderr, "Hello, world! %d\n", 2); sprintf(buf1, "Hello, world! %d\n", 3); snprintf(buf2, 20, "Hello, world! %d\n", 4); syslog(0, "Hello, world! %d\n", 5); } $ powerpc64le-linux-gnu-gcc demo.c -c $ powerpc64le-linux-gnu-nm demo.o U .TOC. U __fprintfieee128 U __printfieee128 U __snprintfieee128 U __sprintfieee128 U __stack_chk_fail U __syslogieee128 0000000000000000 T demo U stderr [1]: https://bugs.launchpad.net/ubuntu/+bug/2132257 [2]: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist;h=65d78e50760b5d6b1a9cb39016a7bf8064224794;hb=HEAD#l2519 [3]: https://doc.rust-lang.org/1.96.0/rustc/platform-support.html
1 parent ab4d04f commit 1d9ef30

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

libc-test/build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3805,6 +3805,8 @@ fn test_linux(target: &str) {
38053805
let i686 = target.contains("i686");
38063806
let ppc = target.contains("powerpc");
38073807
let ppc64 = target.contains("powerpc64");
3808+
let ppc64le = target.contains("powerpc64le");
3809+
let _ppc64be = target.contains("powerpc64-");
38083810
let ppc32 = ppc && !ppc64;
38093811
let s390x = target.contains("s390x");
38103812
let sparc = target.contains("sparc");
@@ -4950,6 +4952,10 @@ fn test_linux(target: &str) {
49504952
// FIXME(linux): function pointers changed since Ubuntu 23.10
49514953
"strtol" | "strtoll" | "strtoul" | "strtoull" | "fscanf" | "scanf" | "sscanf" => true,
49524954

4955+
// FIXME(ppc): function pointers changed in Ubuntu 26.04 to support IEEE binary128
4956+
// `long double`. We should update at some point but there is no hurry.
4957+
"printf" | "fprintf" | "sprintf" | "snprintf" | "syslog" if gnu && ppc64le => true,
4958+
49534959
_ => false,
49544960
}
49554961
});

0 commit comments

Comments
 (0)