Skip to contentSkip to conversation

Compiler flags for libapi and libtraceevent

DISCUSSION Ben Hutchings 2 participants 2 messages Sep 11, 2018 – Sep 13, 2018

lore
Share & tools
lore
#0 lore raw

I noticed that tools/lib/api/Makefile has these conditional assignments, similar to tools/perf/Makefile.config:

ifeq ($(DEBUG),0)
ifeq ($(CC_NO_CLANG), 0)
CFLAGS += -O3
else
CFLAGS += -O6
endif
endif

ifeq ($(DEBUG),0)
CFLAGS += -D_FORTIFY_SOURCE
endif

But it doesn't set DEBUG to 0 by default, and nothing under tools/perf exports its value of CFLAGS or DEBUG.

tools/lib/traceevent/Makefile doesn't seem to have any logic to enable optimisation or Fortify.

Shouldn't these libraries both have optimisations and Fortify turned on by default, like perf itself?

Ben.

Signature · 2 lines
Ben Hutchings
Computers are not intelligent.	They only think they are.
#1 lore raw
Quoted 11 lines · Ben Hutchings

I noticed that tools/lib/api/Makefile has these conditional assignments, similar to tools/perf/Makefile.config:

ifeq ($(DEBUG),0)
ifeq ($(CC_NO_CLANG), 0)
CFLAGS += -O3
else
CFLAGS += -O6
endif
endif

Quoted 6 lines

ifeq ($(DEBUG),0)
CFLAGS += -D_FORTIFY_SOURCE
endif

But it doesn't set DEBUG to 0 by default, and nothing under tools/perf exports its value of CFLAGS or DEBUG.

hum, AFAICS tools/perf/Makefile.perf exports CFLAGS:

export srctree OUTPUT RM CC CXX LD AR CFLAGS CXXFLAGS V BISON FLEX AWK

jirka

Quoted 13 lines

tools/lib/traceevent/Makefile doesn't seem to have any logic to enable optimisation or Fortify.

Shouldn't these libraries both have optimisations and Fortify turned on by default, like perf itself?

Ben.

Signature · 2 lines
Ben Hutchings
Computers are not intelligent.	They only think they are.