Projects
Eulaceura:Factory
nvme-snsd
_service:obs_scm:fix-clang-ldflags.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:fix-clang-ldflags.patch of Package nvme-snsd
diff -u -r nvme-snsd-1.00.029/Makefile nvme-snsd-1.00.029/Makefile --- nvme-snsd-1.00.029/Makefile 2022-07-26 14:23:20.000000000 +0800 +++ nvme-snsd-1.00.029/Makefile 2023-10-30 13:59:09.000000000 +0800 @@ -1,9 +1,17 @@ CFLAGS := -O2 -g -Wall -Werror -std=gnu99 -D_GNU_SOURCE CFLAGS += -fstack-protector-strong -CFLAGS += -fPIE -pie -CFLAGS += -Wl,-z,relro -CFLAGS += -Wl,-z,now -CFLAGS += -Wl,-z,noexecstack + +LDFLAGS := + +ifeq ($(CC),gcc) + CFLAGS += -fPIE -pie + CFLAGS += -Wl,-z,relro + CFLAGS += -Wl,-z,now + CFLAGS += -Wl,-z,noexecstack +else ifeq ($(CC),clang) + CFLAGS += -fPIE + LDFLAGS += -pie -Wl,-z,relro,-z,now,-z,noexecstack +endif RM = rm -f SNSD = nvme-snsd @@ -35,15 +43,15 @@ test/snsd_lldp_test/snsd_lldp_test.o NT_OBJS := test/snsd_nt_test/snsd_nt_test.o - -$(SNSD): $(OBJS) - $(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $(SNSD) -$(LLDP_TEST): $(LLDP_OBJS) - $(CC) $(CFLAGS) $(LLDP_OBJS) -o $(LLDP_TEST) +$(SNSD): $(OBJS) + $(CC) $(CFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $(SNSD) + +$(LLDP_TEST): $(LLDP_OBJS) + $(CC) $(CFLAGS) $(LLDP_OBJS) $(LDFLAGS) -o $(LLDP_TEST) -$(NT_TEST): $(NT_OBJS) - $(CC) $(CFLAGS) $(NT_OBJS) $(LIBS) -o $(NT_TEST) +$(NT_TEST): $(NT_OBJS) + $(CC) $(CFLAGS) $(NT_OBJS) $(LIBS) $(LDFLAGS) -o $(NT_TEST) %.o: %.c %.h $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2