Skip to content

Enable custom CFLAGS and LDFLAGS in "Makefile.linux" #53

@andrei-korshikov

Description

@andrei-korshikov

One patch is better than thousand words:D

diff --git a/src/Makefile.linux b/src/Makefile.linux
index fd765f1..6418b6f 100644
--- a/src/Makefile.linux
+++ b/src/Makefile.linux
@@ -4,8 +4,8 @@ OSTYPE=Linux
 CPUTYPE:=$(shell uname -m)
 HVOPT=-DHV

-CFLAGS=-D$(OSTYPE) -D$(CPUTYPE) $(HVOPT) -Wall -DTAP
-LDFLAGS=-lpthread -lutil
+CFLAGS:=$(CFLAGS) -D$(OSTYPE) -D$(CPUTYPE) $(HVOPT) -Wall -DTAP
+LDFLAGS:=$(LDFLAGS) -lpthread -lutil
 OBJS=vpcs.o \
    daemon.o \
    readline.o \

My use case
I've created vpcs-git package in the Arch Linux User Repository (AUR). During creation, I've got a couple of minor issues:

  • ELF file ('usr/bin/vpcs') lacks FULL RELRO, check LDFLAGS
  • ELF file ('usr/bin/vpcs') lacks GNU_PROPERTY_X86_FEATURE_1_SHSTK

These issues are really minor and not essential, but… what bad things could happen if custom (system-wide) CFLAGS and LDFLAGS would be enabled?

Related issue
#1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions