how to create binaries under bionic/tests/prebuilt-elf-files

63 views
Skip to first unread message

Chen Wang

unread,
Nov 29, 2021, 10:48:26 PM11/29/21
to Android Building
hello, 
I wonder how to build the binaries under bionic/tests/prebuilt-elf-files? I am working on aosp 12 and can not find the script and source code to build these prebuilt binaries?

Thanks in adv.

Elliott Hughes

unread,
Dec 7, 2021, 8:35:03 PM12/7/21
to Android Building
i checked with the original author of those tests, and basically:

1. he compiled an empty .c file into a .so, and checked that in as libtest_empty.so

2. then for each of the invalid files, he used a hex editor to corrupt a copy of the original libtest_empty.so file

for obvious reasons, AOSP never accepts prebuilt blobs from contributors, so that's not a particularly useful path for you to spend any time on :-)

a patch i could accept would be a patch that did the ELF file modification when the test runs instead --- we could check in the trivial .c file, add genrules to build the libtest_empty.so files, and genrules to corrupt them [probably just with hard-coded offsets and data in the build files]. ugly, and a fair amount of work, but better than what we have today, and something we should do at some point anyway!

tbh though, i'd just ignore these files for now --- they're not needed to boot, only to pass CTS. if you're having trouble building because the build system's dependency analysis wants files to be present, just use empty files :-)
Reply all
Reply to author
Forward
0 new messages