You are not logged in.

#1 2021-11-25 10:48:39

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Building with go lacks FULL RELRO, check LDFLAGS [solved]

I created a PKGBUILD for shonenjump which is written in go.  Not being experienced with go, I fear my build command (line 18) is not right.

go build -v -buildmode=pie -ldflags "-extldflags \"$LDFLAGS\""

Although the package builds successfully, namcap complains:

shonenjump W: ELF file ('usr/bin/shonenjump') lacks FULL RELRO, check LDFLAGS.

EDIT: go build -buildmode=pie -ldflags "-linkmode=external -extldflags=$LDFLAGS"

Last edited by graysky (2021-11-25 13:07:26)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2023-10-04 15:09:28

Legendario
Member
From: Brasil
Registered: 2011-06-23
Posts: 2

Re: Building with go lacks FULL RELRO, check LDFLAGS [solved]

I was having the same problem and took me a long time to find the answer. Those 2 pages will help and make your builds pass namcap without a single error
Arch wiki Golang packaging specifics https://wiki.archlinux.org/title/Go_pac … ld_options
And this awesome blog post on medium https://medium.com/@slimm609/checksec-d4131dff0fca

Offline

#3 2023-10-04 22:28:32

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,846
Website

Re: Building with go lacks FULL RELRO, check LDFLAGS [solved]


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB