This is an archive of the discontinued LLVM Phabricator instance.

[llgo] cmd/gllgo: handle/ignore more flags
ClosedPublic

Authored by axw on Jul 16 2015, 9:58 PM.

Details

Summary

This diff is to support Debian packaging,
which sets various hardening-rleated flags
in CFLAGS. They don't make sense for Go,
so we just ignore them.

Diff Detail

Event Timeline

axw updated this revision to Diff 29976.Jul 16 2015, 9:58 PM
axw retitled this revision from to [llgo] cmd/gllgo: handle/ignore more flags.
axw updated this object.
axw added a reviewer: pcc.
axw added a subscriber: llvm-commits.
pcc added inline comments.Jul 17 2015, 1:04 AM
cmd/gllgo/gllgo.go
329

You might want to add a TODO to enable the stack protector anyway; it could still be useful for protecting against the scenario where a C library called via cgo is manipulated into overwriting a Go stack frame.

331–335

It may be simpler to ignore everything beginning with -W, as some other distribution may be using some other set of warning flags.

pcc accepted this revision.Jul 17 2015, 1:09 AM
pcc edited edge metadata.

Otherwise LGTM

This revision is now accepted and ready to land.Jul 17 2015, 1:09 AM
axw updated this revision to Diff 29981.Jul 17 2015, 1:13 AM
axw edited edge metadata.
  • Ignore all -W prefixes (apart from -Wl,)
  • add TODO to handle -fstack-protector*
axw marked 2 inline comments as done.Jul 17 2015, 1:13 AM
This comment was removed by axw.
axw closed this revision.Jul 17 2015, 1:15 AM