Include CGO_CFLAGS and CGO_LDFLAGS in the make command
Set the value of CGO_CFLAGS as the CFLAGS environment variable value and CGO_LDFLAGS as the LDFLAGS value as part of the make command The goal is to include the hardening compilation flags when building the Go binaries with CGO enabled. Also add -compressdwarf=false to ldflags, make the build verbose by adding the options -v -x, and force rebuilding by adding the -a option. Resolves: RHEL-33498 Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
This commit is contained in:
parent
4901e2f8c2
commit
14364ed60c
@ -70,13 +70,13 @@ gzip -cd %{SOURCE0} | %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1
|
|||||||
%autosetup -p1
|
%autosetup -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%make_build prefix=%{_prefix} lib=%{_lib} SBINDIR=%{_sbindir} CGO_REQUIRED=1 GO_BUILD_FLAGS="-buildmode=pie -ldflags='-B gobuildid'" all
|
%make_build prefix=%{_prefix} lib=%{_lib} SBINDIR=%{_sbindir} CGO_REQUIRED=1 CGO_CFLAGS="${CFLAGS}" CGO_LDFLAGS="${LDFLAGS}" GO_BUILD_FLAGS="-buildmode=pie -a -v -x -ldflags='-compressdwarf=false -B gobuildid'" all
|
||||||
|
|
||||||
%check
|
%check
|
||||||
make test
|
make test
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install prefix=%{_prefix} lib=%{_lib} SBINDIR=%{_sbindir} CGO_REQUIRED=1 GO_BUILD_FLAGS="-buildmode=pie -ldflags='-B gobuildid'"
|
%make_install prefix=%{_prefix} lib=%{_lib} SBINDIR=%{_sbindir} CGO_REQUIRED=1 CGO_CFLAGS="${CFLAGS}" CGO_LDFLAGS="${LDFLAGS}" GO_BUILD_FLAGS="-buildmode=pie -a -v -x -ldflags='-compressdwarf=false -B gobuildid'"
|
||||||
|
|
||||||
mkdir -p %{buildroot}/%{_mandir}/man{2,3,5,8}
|
mkdir -p %{buildroot}/%{_mandir}/man{2,3,5,8}
|
||||||
mv -f doc/*.3 %{buildroot}/%{_mandir}/man3/
|
mv -f doc/*.3 %{buildroot}/%{_mandir}/man3/
|
||||||
@ -126,6 +126,7 @@ chmod +x %{buildroot}/%{_libdir}/*.so.*
|
|||||||
- Fix incompatibility of the build with go 1.22 (by Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com>)
|
- Fix incompatibility of the build with go 1.22 (by Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com>)
|
||||||
- Reenable PIE in the captree tool (by Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com>)
|
- Reenable PIE in the captree tool (by Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com>)
|
||||||
- Use sbindir location provided by rpm (by Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>)
|
- Use sbindir location provided by rpm (by Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>)
|
||||||
|
- Include hardening flags by setting CGO_CFLAGS=CFLAGS and CGO_LDFLAGS=LDFLAGS
|
||||||
|
|
||||||
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.69-3
|
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.69-3
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||||
|
Loading…
Reference in New Issue
Block a user