View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000409 | file | General | public | 2022-12-12 16:37 | 2023-01-08 16:50 |
Reporter | Girgias | Assigned To | christos | ||
Priority | normal | Severity | block | Reproducibility | always |
Status | assigned | Resolution | open | ||
Platform | Linux | OS | CentOS (Core) | OS Version | 7.9.2009 |
Product Version | 5.43 | ||||
Summary | 0000409: Compilation error in softmagic.c due to redefining strndup in AIX preprocessor block | ||||
Description | This was first reported to PHP here: https://github.com/php/php-src/pull/10074 The issue is located between lines 503 and 523 (https://github.com/file/file/blob/master/src/softmagic.c#L503-L523) Where the redeclaration of strndup probably should have been in an else block as otherwise the following compile errors can arise (line numbers inaccurate as it is the patched PHP version to use the PHP memory allocator): /www/server/source/php/php82/ext/fileinfo/libmagic/softmagic.c:507:7: error: expected identifier or ‘(’ before ‘extension’ char *strndup(const char *, size_t); ^ /www/server/source/php/php82/ext/fileinfo/libmagic/softmagic.c:510:1: error: expected identifier or ‘(’ before ‘extension’ strndup(const char *str, size_t n) ^ make: *** [libmagic/softmagic.lo] Error 1 make: *** [libmagic/softmagic.lo] Error 1 | ||||
Tags | No tags attached. | ||||
|
can you provide the preprocessor output cc -E of those lines? |
|
I've just asked the end-user if they can provide this information. |
|
End user came back with this: gcc -E ext/fileinfo/libmagic/softmagic.c [root@VM-EtsmUAZgUPAH php82]# gcc -E ext/fileinfo/libmagic/softmagic.c # 1 "ext/fileinfo/libmagic/softmagic.c" # 1 "<built-in>" # 1 "<command-line>" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 1 "<command-line>" 2 # 1 "ext/fileinfo/libmagic/softmagic.c" # 32 "ext/fileinfo/libmagic/softmagic.c" # 1 "ext/fileinfo/libmagic/file.h" 1 # 36 "ext/fileinfo/libmagic/file.h" # 1 "ext/fileinfo/libmagic/config.h" 1 In file included from ext/fileinfo/libmagic/file.h:36:0, from ext/fileinfo/libmagic/softmagic.c:32: ext/fileinfo/libmagic/config.h:1:17: fatal error: php.h: No such file or directory #include "php.h" ^ compilation terminated. Compile time error libmagic/softmagic.dep -MT libmagic/softmagic.lo -fPIC -DPIC -o libmagic/.libs/softmagic.o In file included from /usr/include/string.h:633:0, from /www/server/php/82/include/php/main/../main/php_config.h:2207, from /www/server/php/82/include/php/Zend/zend_config.h:1, from /www/server/php/82/include/php/Zend/zend_portability.h:43, from /www/server/php/82/include/php/Zend/zend_types.h:25, from /www/server/php/82/include/php/Zend/zend.h:27, from /www/server/php/82/include/php/main/php.h:31, from /www/server/source/php/php82/ext/fileinfo/libmagic/config.h:1, from /www/server/source/php/php82/ext/fileinfo/libmagic/file.h:36, from /www/server/source/php/php82/ext/fileinfo/libmagic/softmagic.c:32: /www/server/source/php/php82/ext/fileinfo/libmagic/softmagic.c:507:7: error: expected identifier or ‘(’ before ‘__extension__’ char *strndup(const char *, size_t); ^ /www/server/source/php/php82/ext/fileinfo/libmagic/softmagic.c:510:1: error: expected identifier or ‘(’ before ‘__extension__’ strndup(const char *str, size_t n) ^ make: *** [libmagic/softmagic.lo] Error 1 Hopefully this is the requested information, and apologies for the delay. |
|
Unfortunately not, since the compilation terminated early because the user did not supply the correct -I path where php.h lives. |
Date Modified | Username | Field | Change |
---|---|---|---|
2022-12-12 16:37 | Girgias | New Issue | |
2022-12-26 19:22 | christos | Assigned To | => christos |
2022-12-26 19:22 | christos | Status | new => assigned |
2022-12-26 19:23 | christos | Status | assigned => feedback |
2022-12-26 19:23 | christos | Note Added: 0003878 | |
2023-01-02 15:54 | Girgias | Note Added: 0003883 | |
2023-01-02 15:54 | Girgias | Status | feedback => assigned |
2023-01-08 15:49 | Girgias | Note Added: 0003884 | |
2023-01-08 16:50 | christos | Note Added: 0003885 |