FS#49313 - GCC header cmath is unable to find math.h if -Isystem is used

Attached to Project: Arch Linux
Opened by Tommy McGuire (mcguire) - Thursday, 12 May 2016, 19:28 GMT
Last edited by Doug Newgard (Scimmia) - Thursday, 12 May 2016, 20:40 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:

Trying to compile a file using "include <cmath>" with a command line argument of "-isystem /usr/include" causes the error:

In file included from math.cc:1:0:
/usr/include/c++/6.1.1/cmath:45:23: fatal error: math.h: No such file or directory
#include_next <math.h>


Additional info:
* gcc 6.1.1-1


Steps to reproduce:
* command line: gcc -o math math.cc -isystem /usr/include
This task depends upon

Closed by  Doug Newgard (Scimmia)
Thursday, 12 May 2016, 20:40 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Don't screw with the search path
Comment by Doug Newgard (Scimmia) - Thursday, 12 May 2016, 19:39 GMT
So don't use -lsystem /usr/include.
Comment by Tommy McGuire (mcguire) - Thursday, 12 May 2016, 19:52 GMT
Well, that didn't work, either.

The problem was discovered when compiling the Pony compiler, which uses LLVM and uses -isystem to put the LLVM header location at the top of the bracket search list. Replacing -isystem with -I works on my Arch box, but breaks the compiler's other builds.

Pony  bug 797 : https://github.com/ponylang/ponyc/issues/797

Loading...