Ensure CFLAGS are passed to probes.o generation

The dtrace python script from systemtap on Linux actually looks at the
CFLAGS environment variable when invoking gcc to make the probes.o file.
If we don't pass the CFLAGS we're using, this probes.o file can wind up
without the required annotations indicating that it supports e.g. Intel
CET.

Fix this by explicitly exporting our build flags to the environment for
this script.

[Bug #18061]
This commit is contained in:
KJ Tsanaktsidis 2024-07-06 14:57:57 +10:00
Родитель b940de83de
Коммит 3381c60836
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -478,8 +478,9 @@ probes.stamp: $(DTRACE_REBUILD_OBJS)
probes.$(OBJEXT): $(srcdir)/probes.d $(DTRACE_REBUILD:yes=probes.stamp)
@$(ECHO) processing probes in object files
$(Q) $(RM) $@
$(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_REBUILD_OBJS)
@# n.b. the dtrace script looks at the $CFLAGS environment variable to decide
@# how to assemble probes.o; so we need to actually _export_ $(CFLAGS)
$(Q) CFLAGS="$(CFLAGS) $(XCFLAGS) $(CPPFLAGS)" $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_REBUILD_OBJS)
# DTrace static library hacks described here:
# https://marc.info/?l=opensolaris-dtrace-discuss&m=114761203110734&w=4