Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 803433
Summary: | triplet path not being properly set/detected by clang/llvm | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | D. Marlin <dmarlin> | ||||
Component: | llvm | Assignee: | Tom Stellard <tstellar> | ||||
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 24 | CC: | ajax, bos, bressers, dmalcolm, fweimer, michel, pbrobinson, peterm, rth, samuel-rhbugs, tstellar, yury | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | arm | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2017-08-08 11:40:34 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: | 245418, 485251 | ||||||
Attachments: |
|
Description
D. Marlin
2012-03-14 17:26:46 UTC
Looking at this a bit more, it seems the bug may be in the clang tools. I can reproduce the error with a simple hello.c program: $ clang -D LINUX=1 -D BSD=1 -c -o hello.o hello.c clang: warning: unknown platform, assuming -mfloat-abi=soft $ clang -D LINUX=1 -D BSD=1 hello.o -o hello /bin/ld: cannot find crtbegin.o: No such file or directory /bin/ld: cannot find -lgcc /bin/ld: cannot find -lgcc_s clang: error: linker command failed with exit code 1 (use -v to see invocation) Changing component to llvm. The triplet is being incorrectly set. clang believes its armv7l-unknown-linux-gnueabi where our gcc puts the gcc bits in armv7hl-redhat-linux-gnueabi where crtbegin.o resides. More details here http://www.advogato.org/person/redi/diary/228.html Created attachment 696461 [details]
llvm-3.2-clang-driver-secondary-arch-triplets.patch
I wonder if this patch might be enough for llvm-3.2.
For llvm-3.1 there seems to be no ARMHFTriples, just ARMTriples though.
(In reply to comment #4) > Created attachment 696461 [details] > llvm-3.2-clang-driver-secondary-arch-triplets.patch > > I wonder if this patch might be enough for llvm-3.2. > > For llvm-3.1 there seems to be no ARMHFTriples, just ARMTriples though. I think land it in the release and we'll review and evolve as necessary. I committed the above patch to pkg git master. I should check upstream svn to see if llvm-3.3 will have any such anticipated triplet changes. Wasn't good enough - trying another patch. Changing "redhat-linux-gnueabi" to "redhat-linux" in the patch didn't help. Still got: # clang -v -fsyntax-only -x c++ /dev/null clang version 3.2 (tags/RELEASE_32/final) Target: armv7hl-redhat-linux-gnu Thread model: posix clang: warning: unknown platform, assuming -mfloat-abi=soft "/usr/bin/clang" -cc1 -triple armv4t-redhat-linux-gnu -fsyntax-only -disable-free -disable-llvm-verifier -main-file-name null -mrelocation-model static -mdisable-fp-elim -fmath-errno -mconstructor-aliases -target-abi apcs-gnu -target-cpu arm7tdmi -msoft-float -mfloat-abi soft -target-feature +soft-float -target-feature +soft-float-abi -target-feature -neon -target-linker-version 2.23.51.0.9 -momit-leaf-frame-pointer -v -resource-dir /usr/bin/../lib/clang/3.2 -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.2/include -internal-externc-isystem /usr/include -internal-externc-isystem /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.0/include -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir / -ferror-limit 19 -fmessage-length 174 -mstackrealign -fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -x c++ /dev/null clang -cc1 version 3.2 based upon LLVM 3.2svn default target armv7hl-redhat-linux-gnu #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/bin/../lib/clang/3.2/include /usr/include /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.0/include End of search list. Not sure where the armv4t-redhat-linux-gnu is coming from... Well there are a couple of simple workarounds: 1) most direct is using -mfloat-abi=hard, eg: # clang -v -fsyntax-only -x c++ /dev/null -mfloat-abi=hard clang version 3.2 (tags/RELEASE_32/final) Target: armv7hl-redhat-linux-gnu Thread model: posix "/usr/bin/clang" -cc1 -triple armv4t-redhat-linux-gnu -fsyntax-only -disable-free -disable-llvm-verifier -main-file-name null -mrelocation-model static -mdisable-fp-elim -fmath-errno -mconstructor-aliases -target-abi apcs-gnu -target-cpu arm7tdmi -mfloat-abi hard -target-linker-version 2.23.51.0.9 -momit-leaf-frame-pointer -v -resource-dir /usr/bin/../lib/clang/3.2 -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.2/include -internal-externc-isystem /usr/include -internal-externc-isystem /usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.8.0/include -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir / -ferror-limit 19 -fmessage-length 174 -mstackrealign -fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -x c++ /dev/null 2) probably the simplest hack would just be to patch clang on armv7hl, etc to default to hard float. That is a trivial one line patch but it would be better to straighten out the redhat triplets for ARM (and any other secondary archs needed) as others have also said. Perhaps some patching is also needed to llvm, not just clang. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19 (In reply to comment #8) > 2) probably the simplest hack would just be to patch clang on armv7hl, > etc to default to hard float. I see ausil did this in llvm-3.2-3.fc20. Hopefully llvm-3.2-4.fc20 with fixed old bogus date will complete in arm koji. For the record with llvm-3.2-2.fc20 (before the hack patch) I see: make[1]: Entering directory `/builddir/build/BUILD/diskdev_cmds-540.1.linux3/fsck_hfs.tproj' clang -g3 -Wall -fblocks -I/builddir/build/BUILD/diskdev_cmds-540.1.linux3/BlocksRunTime -I/builddir/build/BUILD/diskdev_cmds-540.1.linux3/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1 -D VERSION=\"540.1.linux3\" -c -o fsck_hfs.o fsck_hfs.c clang -g3 -Wall -fblocks -I/builddir/build/BUILD/diskdev_cmds-540.1.linux3/BlocksRunTime -I/builddir/build/BUILD/diskdev_cmds-540.1.linux3/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1 -D VERSION=\"540.1.linux3\" -c -o utilities.o utilities.c clang -g3 -Wall -fblocks -I/builddir/build/BUILD/diskdev_cmds-540.1.linux3/BlocksRunTime -I/builddir/build/BUILD/diskdev_cmds-540.1.linux3/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1 -D VERSION=\"540.1.linux3\" -c -o cache.o cache.c clang -g3 -Wall -fblocks -I/builddir/build/BUILD/diskdev_cmds-540.1.linux3/BlocksRunTime -I/builddir/build/BUILD/diskdev_cmds-540.1.linux3/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1 -D VERSION=\"540.1.linux3\" -c -o fsck_messages.o fsck_messages.c clangclangclangclang: : : warning: warning: warning: unknown platform, assuming -mfloat-abi=softunknown platform, assuming -mfloat-abi=soft unknown platform, assuming -mfloat-abi=soft clangclang: clang: warning: : warning: unknown platform, assuming -mfloat-abi=softwarning: unknown platform, assuming -mfloat-abi=soft unknown platform, assuming -mfloat-abi=soft : warning: unknown platform, assuming -mfloat-abi=soft clang: warning: unknown platform, assuming -mfloat-abi=soft In file included from In file included from fsck_messages.c:25: In file included from /usr/include/assert.hIn file included from :36cache.c: :In file included from /usr/include/features.h24:: 399In file included from : /usr/include/errno.h:28/usr/include/gnu/stubs.h: In file included from :/usr/include/features.h7::39911: : fatal error: /usr/include/gnu/stubs.h'gnu/stubs-soft.h' file not found: 7:11: fatal error: 'gnu/stubs-soft.h' file not found # include <gnu/stubs-soft.h># include <gnu/stubs-soft.h> ^ ^ In file included from utilities.c:56: In file included from /usr/include/sys/types.h:25: In file included from /usr/include/features.h:399: /usr/include/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-soft.h' file not found # include <gnu/stubs-soft.h> ^ fsck_hfs.c:23: (In reply to comment #12) > Hopefully llvm-3.2-4.fc20 with fixed old bogus date will complete in arm > koji. The original llvm-3.2-3.fc20.armv7hl build failure was a perl issue and it is built now. I filed a bug upstream finally about the ARM triplets: http://llvm.org/bugs/show_bug.cgi?id=15666 Unforunately Dennis' patch to default to hw fp didn't help much: : clang: warning: unknown platform, assuming -mfloat-abi=hard In file included from In file included from cache.c:24: In file included from /usr/include/errno.h:28: In file included from /usr/include/features.h:399: /usr/include/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-soft.h' file not found # include <gnu/stubs-soft.h> ^ fsck_messages.c:25: : so looks like we really need a proper triplet fix indeed. Upstream bug report: http://llvm.org/bugs/show_bug.cgi?id=15557 I see only one usage site for the clang blocks extension. I can port it to C++11 or even C99 so that the program can be compiled with GCC. Would that help? (In reply to Florian Weimer from comment #17) > I see only one usage site for the clang blocks extension. I can port it to > C++11 or even C99 so that the program can be compiled with GCC. Would that > help? I should have said that this offer refers to the original hfsplus-tools build failure. FWIW flterm is another package that needs llvm/clang and was FTBFS, I updated it and tested it and it built fine with the attempted fix. I'm not sure if that's due to the fix or due to changes in the new upstream version though. (In reply to Florian Weimer from comment #18) > (In reply to Florian Weimer from comment #17) > > I see only one usage site for the clang blocks extension. I can port it to > > C++11 or even C99 so that the program can be compiled with GCC. Would that > > help? > > I should have said that this offer refers to the original hfsplus-tools > build failure. That would be lovely! I would much prefer to build with gcc. (In reply to Adam Jackson from comment #20) > That would be lovely! I would much prefer to build with gcc. I got morbidly curious about just what the blocks usage was for, and it turned out to be entirely straightforward to rewrite in C89. So that's fixed, at least, but clang still doesn't really work on arm. This message is a notice that Fedora 19 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 19. It is Fedora's policy to close all bug reports from releases that are no longer maintained. Approximately 4 (four) weeks from now this bug will be closed as EOL if it remains open with a Fedora 'version' of '19'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 19 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. This message is a reminder that Fedora 21 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 21. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '21'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 21 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle. Changing version to '24'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase Is this still an issue? This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This message is a reminder that Fedora 24 is nearing its end of life. Approximately 2 (two) weeks from now Fedora will stop maintaining and issuing updates for Fedora 24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '24'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 24 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. |