berrange / go-rpm-macros

Forked from go-rpm-macros 4 years ago
Clone

d497c47 macros: remove arch conditional for setting pie flag

Authored and Committed by berrange 4 years ago
    macros: remove arch conditional for setting pie flag
    
    The use of the %ifnarch conditional to control use of
    the '-buildmode pie' flag presents a problem for future
    patches which aim to allow Go build flags to be assigned
    to an shell env variable. There is no way to get rid of
    the leading and trailing newlines as %ifnarch must be
    on a separate line from the %{expand: clause.
    
    To eliminate this conditional, create two new files,
    macros.go-compilers-golang-{pie,nopie} which both define
    a %gocompilerflags macro. Only one of the two files should
    be installed, depending on whether the build architecture
    supports pie or not.
    
    Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>