Bug 1241130

Summary: arm-none-eabi-gcc-cs-c++ - missing libraries and include files
Product: [Fedora] Fedora Reporter: dr-ru
Component: arm-none-eabi-gcc-csAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 22CC: atu, mhlavink
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.2.0-2.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-24 05:13:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description dr-ru 2015-07-08 14:08:14 UTC
No possible to compile source that use standard headers like cstdlib, cstdint and etc.


Version-Release number of selected component (if applicable):
arm-none-eabi-gcc-cs-c++-4.9.2-3.fc22.x86_64.rpm
arm-none-eabi-binutils-cs-2014.05.28-3.fc22.x86_64.rpm
arm-none-eabi-newlib-2.2.0_1-1.fc22.noarch.rpm
arm-none-eabi-gdb-7.6.2-2.fc22.x86_64.rpm
arm-none-eabi-gcc-cs-4.9.2-3.fc22.x86_64.rpm

How reproducible:
Just compile any file that use standard C++ include files like this:

#include <cstdlib.h>


int
main(int argc, char* argv[])
{
    return 0;
}


Steps to Reproduce:
1. arm-none-eabi-g++ main.cpp

Actual results:
$ arm-none-eabi-g++ main.cpp 
main.cpp:1:21: fatal error: cstdlib.h: No such file or directory
 #include <cstdlib.h>
                     ^
compilation terminated.


Expected results:
Success compilation

Comment 1 Anton Guda 2015-08-24 11:51:41 UTC
AFAIK, cstdlib.h in not a part of standard C or C++ library.
3 way to resolve:
1: use C approach: #inclide <stdlib.h>
2: use C++ approach: #inclide <cstdlib> (+ using namespace std if required)
3: port boost to arm-none....

I found more strange bug: 
This package is compiled in bootstrap mode and used only to solve circular 
build dependency. You don't want to use this package. It's not expected to
work.

But is was after F23 mass rebuild!

Comment 2 dr-ru 2015-08-24 12:01:41 UTC
(In reply to Anton Guda from comment #1)
> AFAIK, cstdlib.h in not a part of standard C or C++ library.
> 3 way to resolve:
> 1: use C approach: #inclide <stdlib.h>
> 2: use C++ approach: #inclide <cstdlib> (+ using namespace std if required)
> 3: port boost to arm-none....
> 
> I found more strange bug: 
> This package is compiled in bootstrap mode and used only to solve circular 
> build dependency. You don't want to use this package. It's not expected to
> work.
> 
> But is was after F23 mass rebuild!

Adding <cstdlib> instead of <cstdlib.h> has no effect on compilation:
main.cpp:1:19: fatal error: cstdlib: No such file or directory
 #include <cstdlib>
                   ^
compilation terminated.

This is due to the fact that the g++ is installed without any include files...

Comment 3 dr-ru 2015-08-24 12:04:17 UTC
(In reply to dr-ru from comment #2)
> (In reply to Anton Guda from comment #1)
> > AFAIK, cstdlib.h in not a part of standard C or C++ library.
> > 3 way to resolve:
> > 1: use C approach: #inclide <stdlib.h>
> > 2: use C++ approach: #inclide <cstdlib> (+ using namespace std if required)
> > 3: port boost to arm-none....
> > 
> > I found more strange bug: 
> > This package is compiled in bootstrap mode and used only to solve circular 
> > build dependency. You don't want to use this package. It's not expected to
> > work.
> > 
> > But is was after F23 mass rebuild!
> 
> Adding <cstdlib> instead of <cstdlib.h> has no effect on compilation:
> main.cpp:1:19: fatal error: cstdlib: No such file or directory
>  #include <cstdlib>
>                    ^
> compilation terminated.
> 
> This is due to the fact that the g++ is installed without any include
> files...


Also, this package installed without libraries:
#arm-none-eabi-g++ main.cpp
/usr/lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status

main.cpp:
#include <stdlib.h>


int
main(int argc, char* argv[])
{
    return 0;
}

Comment 4 Fedora Update System 2015-09-04 09:19:41 UTC
arm-none-eabi-gcc-cs-5.2.0-2.fc23 arm-none-eabi-newlib-2.2.0_1-6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-15077

Comment 5 Fedora Update System 2015-09-04 23:18:40 UTC
arm-none-eabi-gcc-cs-5.2.0-2.fc21, arm-none-eabi-newlib-2.2.0_1-6.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update arm-none-eabi-gcc-cs arm-none-eabi-newlib'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-15075

Comment 6 Fedora Update System 2015-09-04 23:20:26 UTC
arm-none-eabi-gcc-cs-5.2.0-2.fc22, arm-none-eabi-newlib-2.2.0_1-6.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update arm-none-eabi-gcc-cs arm-none-eabi-newlib'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-15076

Comment 7 Fedora Update System 2015-09-04 23:22:24 UTC
arm-none-eabi-gcc-cs-5.2.0-2.fc23, arm-none-eabi-newlib-2.2.0_1-6.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update arm-none-eabi-gcc-cs arm-none-eabi-newlib'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-15077

Comment 8 Anton Guda 2015-09-05 12:47:21 UTC
It works for me!
At least all examples from my library (https://github.com/atu-guda/stm32oxc)
rebuilds without problems.

Comment 9 Fedora Update System 2015-09-24 05:13:37 UTC
arm-none-eabi-gcc-cs-5.2.0-2.fc23, arm-none-eabi-newlib-2.2.0_1-6.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2015-09-24 08:26:09 UTC
arm-none-eabi-gcc-cs-5.2.0-2.fc22, arm-none-eabi-newlib-2.2.0_1-6.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2015-09-24 14:19:18 UTC
arm-none-eabi-gcc-cs-5.2.0-2.fc21, arm-none-eabi-newlib-2.2.0_1-6.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.