• Gustavo Niemeyer's avatar
    cgo: restrict #cgo directives to prevent shell expansion · a825e8a6
    Gustavo Niemeyer authored
    Fixes issue #1879.
    
    Directives were not directly expanded, but since their
    content ended up in makefiles, further expansion would
    take place there.  This prevents such artifacts by
    restricting the set of characters that may be used in
    a directive value.
    
    To build the list of safe characters I went through the
    contents of /usr/lib/pkgconfig and extracted LDFLAGS
    and CFLAGS information, so hopefully this is a
    reasonable default to get started.
    
    R=rsc
    CC=golang-dev
    https://golang.org/cl/4532092
    a825e8a6
gcc.go 33.1 KB