Bug 178343
Summary: | h2ph problem with gcc internal defines | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jason Vas Dias <jvdias> | ||||||
Component: | perl | Assignee: | Robin Norwood <robin.norwood> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | David Lawrence <dkl> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | rawhide | CC: | perl-devel | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | 5.8.6-24 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2006-10-04 18:40:19 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 185406 | ||||||||
Attachments: |
|
Description
Jason Vas Dias
2006-01-19 17:07:37 UTC
Now that h2ph correctly picks up the gcc C standard includes, such as limits.h, from the gcc internal include directory (ie. /usr/lib/gcc/*.../include), which it was not doing before, due to bug 172236, some perl .ph files cannot be included because they refer to the newer gcc versions 'internal definitions' such as __INT_MAX__ / __LONG_MAX__ , which are no longer #define'd in any header file, but are 'built-in' to the newer gcc compilers, in the same way as __FILE__ or __LINE__ : $ echo 'int main(int argc, char **argv, char **envp) { long l=__LONG_MAX__; printf( "%ld\n",l); };' >tlm.c ( NOTE: no files are #include-ed ) $ gcc -o tlm tlm.c$ gcc -o tlm tlm.c tlm.c: In function âmainâ: tlm.c:1: warning: incompatible implicit declaration of built-in function âprintfâ $ ./tlm 2147483647 gcc's C standard headers define constants such as LONG_MAX / INT_MAX in terms of these internal definitions: $ egrep 'define\ (INT|LONG)_MAX' limits.h #define INT_MAX __INT_MAX__ #define LONG_MAX __LONG_MAX__ During the generation of the perl platform h2ph includes, we should create a file included by limits.ph that includes definitions for all the gcc 'internal definitions' such as __LONG_MAX__ that might be referenced . Created attachment 123451 [details]
Program to produce perl header for C built-in definitions
Something like the output of this program needs to be prepended to limits.ph
during the build of the perl h2ph platform headers .
I must be missing something, but why do you try to extract GCC proprietary, internals? #include <limits.h> and printing the corresponding POSIX defines would be portable. C.f. http://www.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html RE: Comment #3: /usr/include/limits.h just #includes' gcc's limits.h, unless '__GNUC__ < 2', and gcc's limits.h would in any case be found first in by a '#include <limits.h>' . The whole issue of h2ph and perl's platform includes needs a major revamp, which it will get once perl-5.8.8 comes out (soon, I hope). OK, it wasn't fixed in 5.8.8. I've now raised upstream perl bug #38385 : http://rt.perl.org/rt3/Ticket/Display.html?id=38385 on this issue, which includes a patch to fix it. This will be fixed in the next perl releases for RHEL-4, FC-4, and FC-5 (RHEL-3 is unaffected). Created attachment 124075 [details]
Program to include cpp internal built-in macros in system _h2ph_pre.ph
This problem is fixed with perl-5.8.8-1 in FC-5, with the patch sent upstream, which checks for the existence of cpp internal built-ins in Configure, and writes them to $Config{cppsymbols} so they are correctly written to _h2ph_pre.pl. This patch will be applied to subsequent perl releases for FC-4 and RHEL-4 , but this problem probably does not warrant a complete perl respin just to fix it. Meanwhile, simply run the 'patch_h2ph_pre.pl' script attached above, as root, and the system _h2ph_pre.ph (which gets included by every perl header file) will be patched to define cpp built-ins it does not already define . From User-Agent: XML-RPC perl-5.8.6-24 has been pushed for FC4, which should resolve this issue. If these problems are still present in this version, then please make note of it in this bug report. perl-5.8.6-24 has been pushed for FC4, which should resolve this issue. If these problems are still present in this version, then please make note of it in this bug report. assigning to rnorwood |