ncbi / amr

AMRFinderPlus - Identify AMR genes and point mutations, and virulence and stress resistance genes in assembled bacterial nucleotide and protein sequence.
https://www.ncbi.nlm.nih.gov/pathogens/antimicrobial-resistance/AMRFinder/
Other
256 stars 34 forks source link

Makefile: add linker flags for binaries #132

Closed kbipinkumar closed 5 months ago

kbipinkumar commented 9 months ago

Thanks for merging the PR #131

in additon to ptaching $(DESTDIR) variable we were also patching $(LDFLAGS) linker flags into makefile. the binaries generated by unpatched makefile lacked RELRO mitigations.

amrfinderplus W: ELF file ('usr/bin/amr_report') lacks FULL RELRO, check LDFLAGS.
amrfinderplus W: ELF file ('usr/bin/amrfinder') lacks FULL RELRO, check LDFLAGS.
amrfinderplus W: ELF file ('usr/bin/amrfinder_index') lacks FULL RELRO, check LDFLAGS.
amrfinderplus W: ELF file ('usr/bin/amrfinder_update') lacks FULL RELRO, check LDFLAGS.
amrfinderplus W: ELF file ('usr/bin/dna_mutation') lacks FULL RELRO, check LDFLAGS.
amrfinderplus W: ELF file ('usr/bin/fasta2parts') lacks FULL RELRO, check LDFLAGS.
amrfinderplus W: ELF file ('usr/bin/fasta_check') lacks FULL RELRO, check LDFLAGS.
amrfinderplus W: ELF file ('usr/bin/fasta_extract') lacks FULL RELRO, check LDFLAGS.
amrfinderplus W: ELF file ('usr/bin/gff_check') lacks FULL RELRO, check LDFLAGS.

Major distros including archlinux strongly encourages RELRO mitigations be applied to binaries.

Adding $(LDFLAGS) to the Makefile will allow binaries to be built using the appropriate linker flags set in the build server environment.

evolarjun commented 9 months ago

I have some deadlines in the next two weeks, so it may take some time, but I'll definitely take a look before the next release. Thanks!