Generate GNU compatible build-id for mockkms golang binary (#7389)

* Generate GNU compatible build-id for mockkms golang binary

Description

 diff-1: Fix compilation issue

Generate GNU compatible build-id for mockkms golang binary
Leverage "cgo" to generate build-id

Testing

Debian package build, verified the GNU build-id
This commit is contained in:
Ata E Husain Bohra 2022-06-15 10:43:46 -07:00 committed by GitHub
parent 8808d93813
commit 9396b691b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -24,6 +24,15 @@
package main
// Importing module enable .note.gnu.build-id insertion in the ELF executable.
// Few drawbacks of the scheme are:
// 1. Potentialy slower builds
// 2. No cross-compilation support
// 3. Limited `go tools` availability.
// TODO: Replace with a better scheme if possible.
import "C"
import (
"log"
"math/rand"