[issue36162] error: implicit declaration of function 'sendfile' is invalid in C99

2019-03-06 Thread Inada Naoki


Change by Inada Naoki :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36162] error: implicit declaration of function 'sendfile' is invalid in C99

2019-03-06 Thread muhzi


muhzi  added the comment:

Yeah, makes sense

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36162] error: implicit declaration of function 'sendfile' is invalid in C99

2019-03-05 Thread Inada Naoki


Inada Naoki  added the comment:

May I close this issue?  I feel target SDK v21 is too old.

https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html

--
nosy: +inada.naoki

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36162] error: implicit declaration of function 'sendfile' is invalid in C99

2019-03-02 Thread Chih-Hsuan Yen


Chih-Hsuan Yen  added the comment:

CPython requires several changes to build for Android < 21. There was an 
attempt in issue32654 but it's abandoned.

--
nosy: +yan12125

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36162] error: implicit declaration of function 'sendfile' is invalid in C99

2019-03-02 Thread muhzi


muhzi  added the comment:

err, wrong logs sorry... 

configure:11514: checking for truncate
configure:11514: armv7a-linux-androideabi16-clang -o conftest   -pie 
-march=armv7-a -Wl,--fix-cortex-a8 conftest.c -ldl  >&5
configure:11514: $? = 0
configure:11514: result: yes


configure:7954: checking sys/sendfile.h usability
configure:7954: armv7a-linux-androideabi16-clang -c   conftest.c >&5
configure:7954: $? = 0
configure:7954: result: yes
configure:7954: checking sys/sendfile.h presence
configure:7954: armv7a-linux-androideabi16-clang -E  conftest.c
configure:7954: $? = 0
configure:7954: result: yes
configure:7954: checking for sys/sendfile.h
configure:7954: result: yes

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36162] error: implicit declaration of function 'sendfile' is invalid in C99

2019-03-02 Thread muhzi


muhzi  added the comment:

Yes it is detected by configure because they exist.

>From config.log:

configure:11514: checking for truncate
configure:11514: armv7a-linux-androideabi21-clang -o conftest   -pie 
-march=armv7-a -Wl,--fix-cortex-a8 conftest.c -ldl  >&5
configure:11514: $? = 0
configure:11514: result: yes


I can include the corresponding headers in a separate test file and call these 
missing methods and I get no compilation errors. But it seems they don't work 
in posixmodule.c and for some reason when #include  is put 
before #include "Python.h", the compiler doesn't give errors for those 
particular functions. I'm guessing this is an API level < 21 issue, it might 
have propagated from the configuration step (if any faults) but not sure. I use 
the same steps to compile this for API level 21 with no errors.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36162] error: implicit declaration of function 'sendfile' is invalid in C99

2019-03-02 Thread Christian Heimes


Christian Heimes  added the comment:

The presence of sendfile and truncate is detected by configure. Your copy of 
configure defines HAVE_SENDFILE and HAVE_SYS_SENDFILE_H. Please check 
config.log and see why configure detects the functions.

--
nosy: +christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36162] error: implicit declaration of function 'sendfile' is invalid in C99

2019-03-01 Thread muhzi


muhzi  added the comment:

After some testing, it works and builds extensions OK for android arm with 
API>=21. fails on lower API versions (e.g. 16).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36162] error: implicit declaration of function 'sendfile' is invalid in C99

2019-03-01 Thread muhzi


muhzi  added the comment:

Using the latest NDK r19. Here is my compilation steps for arm:

export PATH="$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH"
export CC="armv7a-linux-androideabi16-clang"
export CXX="$CC++"

export AR="arm-linux-androideabi-ar"
export LD="arm-linux-androideabi-ld"
export AS="arm-linux-androideabi-as"
export STRIP="arm-linux-androideabi-strip"
export RANLIB="arm-linux-androideabi-ranlib"
export READELF="arm-linux-androideabi-readelf"

export CFLAGS=""
export CXXFLAGS=$CFLAGS
export LDFLAGS="-pie"

export CONFIG_SITE="config.site"

./configure --host=armv7a-linux-androideabi --build=x86_64-linux-gnu 
--disable-ipv6
make
make altinstall DESTDIR=$INSTALL_DIR

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36162] error: implicit declaration of function 'sendfile' is invalid in C99

2019-03-01 Thread muhzi


New submission from muhzi :

I encountered yet another issue with cross compilation on android, it so 
happens that these errors occur only when I cross compile for non 64-bit archs. 
i.e. I could cross compile just fine for arm64 & x86_64 but the 32-bit version 
of these archs produces the following error during compilation:

./Modules/posixmodule.c:8457:19: error: implicit declaration of function 
'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
ret = sendfile(out, in, NULL, count);
  ^
./Modules/posixmodule.c:8457:19: warning: this function declaration is not a 
prototype [-Wstrict-prototypes]
./Modules/posixmodule.c:8470:15: error: implicit declaration of function 
'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
ret = sendfile(out, in, &offset, count);
  ^
./Modules/posixmodule.c:9057:14: error: implicit declaration of function 
'truncate' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = truncate(path->narrow, length);
 ^
./Modules/posixmodule.c:9057:14: note: did you mean 'ftruncate'?
/home/muhzi/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/unistd.h:220:5:
 note: 'ftruncate' declared here
int ftruncate(int __fd, off_t __length) __RENAME(ftruncate64) 
__INTRODUCED_IN(12);
^
./Modules/posixmodule.c:9057:14: warning: this function declaration is not a 
prototype [-Wstrict-prototypes]
result = truncate(path->narrow, length);


I attached pyconfig.h for reference, it seems that the configuration step went 
fine. I checked that these missing functions are able to have their 
corresponding headers included. Also figured after misplacing some include 
lines in posixmodule.c that when the preprocessor includes Python.h it fails to 
include definitions from successively included headers.

--
components: Cross-Build
files: pyconfig.h
messages: 336958
nosy: Alex.Willmer, muhzi, xdegaye
priority: normal
severity: normal
status: open
title: error: implicit declaration of function 'sendfile' is invalid in C99
versions: Python 3.7
Added file: https://bugs.python.org/file48183/pyconfig.h

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com