This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Android added %a printf starting with Android L (API 21). | |
Feature(name='android-no-printf-a', | |
when=lambda cfg: _isAndroid(cfg) and not _isAndroidApiAtLeast(cfg, 21) and | |
not programSucceeds(cfg, """ | |
#include <stdio.h> | |
#include <string.h> | |
int main(int, char**) { | |
char buf[100]; | |
snprintf(buf, sizeof(buf), "%a", 0.0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Both the builtins archive and libc.so expose __aeabi_uidiv. Normally, when | |
# generating a shared library, the linker links __aeabi_uidiv from the builtins | |
# archive because it comes first on the linker command-line. However, when | |
# the only reference to __aeabi_uidiv results from LTO code generation, then the | |
# linker instead prefers the __aeabi_uidiv from libc.so. | |
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dedicated to the public domain as per the Creative Commons CC0 | |
// (https://creativecommons.org/about/cc0/). | |
// Compile with C++11 (i.e. -std=c++11) | |
// Tests the behavior of Windows named pipes regarding the lifecycle of | |
// connections. | |
// | |
// This test demonstrates various ways that Wine (as of 1.9.12) differs from | |
// Windows: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile with g++ showkey.cc -o showkey | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <termios.h> | |
#include <unistd.h> | |
static inline char decodeUnixCtrlChar(char ch) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat >dso1.c <<EOF | |
#include <stdio.h> | |
void foo(void) { | |
printf("foo"); | |
printf("\n"); | |
} | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GAS: | |
// arm-linux-gnueabi-gcc -march=armv7-a -c test.s | |
// GNU assembler (GNU Binutils for Debian) 2.35.2 | |
// LLVM: | |
// /x/clang12/bin/clang -target armv7-linux-androideabi -c test.s | |
// clang version 12.0.0 (https://github.com/llvm/llvm-project/ b978a93635b584db380274d7c8963c73989944a1) | |
.syntax unified | |
.thumb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <errno.h> | |
#include <fenv.h> | |
#include <float.h> | |
#include <math.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
const char* round_mode_to_str(int round_mode) { | |
switch (round_mode) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The linker seems to delete the weak version of _bar because it's overridden by a strong | |
version, and when it does, it also deletes _foo's instructions, so calling _foo actually | |
calls an unrelated function, _baz. | |
$ ./weak-to-weak-alias.sh | |
=== objdump | |
a.out: file format Mach-O 64-bit x86-64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
NDK=/x/android-ndk-r21d | |
LIBUNWIND=/x/llvm-upstream/unwind-arm64-21/lib/libunwind.a | |
CXX="$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang++ -fuse-ld=lld $LIBUNWIND" | |
rm -fr out | |
mkdir -p out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
$ /x/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang segv_leaf_unwind.c -funwind-tables -Wl,--export-dynamic -Os | |
$ adb push a.out /data/local/tmp | |
./a.out: 1 file pushed, 0 skipped. 49.8 MB/s (119472 bytes in 0.002s) | |
$ adb shell /data/local/tmp/a.out | |
0x60e1e2f3a8 [sigsegv_handler] | |
0x73fcfe58c0 [__kernel_rt_sigreturn] |
NewerOlder