New issue
Advanced search Search tips

Issue 710518 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug-Regression

Blocked on:
issue 717299



Sign in to add a comment

add -Werror=poison-system-directories for Clang

Project Member Reported by yunlian@chromium.org, Apr 11 2017

Issue description

clang does not support -Werror=poison-system-directories and we want this feature because clang is the main cross compiler now.
 
Can I just emit the warning for clang if
--sysroot is set and /usr/include /usr/local/include are in the include file search path?

Comment 2 by vapier@chromium.org, Apr 26 2017

if you look at the gcc source, we reject more paths than that:
         for (p = heads[chain]; p; p = p->next)
           if (!strncmp (p->name, "/usr/include", 12)
               || !strncmp (p->name, "/usr/local/include", 18)
               || !strncmp (p->name, "/usr/X11R6/include", 18)
               || !strncmp (p->name, "/lib", 4)
               || !strncmp (p->name, "/usr/local/lib", 14))  
             warning (OPT_Wpoison_system_directories,
                      "include location \"%s\" is unsafe for "
                      "cross-compilation", p->name);
note that those are strncmp's, not strcmp's.

i don't have an opinion about making it always fire if --sysroot is active (with a path other than /).

Comment 3 by vapier@chromium.org, May 23 2018

Components: Tools>ChromeOS-Toolchain
Labels: -Type-Bug -Pri-3 Pri-2 Type-Bug-Regression
can we prioritize this? we're starting to see bad flags filter back in to builds because clang isn't rejecting then like gcc did. this is a regression in reliability.
Status: Assigned (was: Untriaged)
This bug has an owner, thus, it's been triaged. Changing status to "assigned".
Cc: llozano@chromium.org
ping ... we're still seeing this happen with packages in the tree and people end up mistriaging them (if they fail at all).  can we please get something going here ?
ok, let me try to find someone to work on this. We are down 2 people at the moment. 
Labels: OS-Chrome
Yunlian had a patch at some point: 

https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/492089

what happened to this?
Blockedon: 717299
Owner: manojgupta@chromium.org

Sign in to add a comment