Skip to content

posixmodule "undeclared function" error when compiling with sanitizer options on Termux (Android) #140317

@theothernighttheotherday

Description

Python fails to compile when compiling with the sanitizer option.

Python/fileutils.c:458:1: warning:                  unused function 'decode_current_locale'       [-Wunused-function]                       458 | decode_current_locale(const char* arg...                                                  | ^~~~~~~~~~~~~~~~~~~~~                 
Python/fileutils.c:677:1: warning:                  unused function 'encode_current_locale'       [-Wunused-function]                       677 | encode_current_locale(const wchar_t *t...                                                 | ^~~~~~~~~~~~~~~~~~~~~                 2 warnings generated.                         
./Modules/posixmodule.c:10400:15: error:            call to undeclared function 'wait3'; ISO      C99 and later do not support implicit         function declarations                         [-Wimplicit-function-declaration]        10400 |         pid = wait3(&status, options, &ru);                                               |               ^                      1 error generated.                            make: *** 
[Makefile:3808: Modules/posixmodule.o] Error 1                                    make: *** Waiting for unfinished jobs...

clang option use.

aarch64-linux-android-clang -fsanitize=address -fsanitize=undefined
aarch64-linux-android-clang++ -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr

aarch64-linux-android-clang --version                                  
 clang version 21.1.3                         
 Target: aarch64-unknown-linux-android24       
Thread model: posix                           
InstalledDir: /data/data/com.termux/files/usr/bin
.git revision is at bedaea05987738c4c6b958d19cec9621bec09f07

Compiling with no sanitizer option works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions