Skip to content

Commit 93b1fd6

Browse files
committed
Tools.gmk: Add annobin GCC plugin
1 parent 9766818 commit 93b1fd6

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

make/devkit/Tools.gmk

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ MPFR := https://www.mpfr.org/${mpfr_ver}/${mpfr_ver}.tar.bz2
195195
GMP := http://ftp.gnu.org/pub/gnu/gmp/${gmp_ver}.tar.bz2
196196
MPC := http://ftp.gnu.org/pub/gnu/mpc/${mpc_ver}.tar.gz
197197
GDB := http://ftp.gnu.org/gnu/gdb/${gdb_ver}.tar.xz
198+
ifneq (,$(annobin_ver))
199+
ANNOBIN := https://nickc.fedorapeople.org/$(annobin_ver).tar.xz
200+
gcc_ver_only := $(patsubst gcc-%,%,$(gcc_ver))
201+
endif
198202

199203
# RPMs used by all BASE_OS
200204
RPM_LIST := \
@@ -280,7 +284,7 @@ define Download
280284
endef
281285

282286
# Download and unpack all source packages
283-
$(foreach p,GCC BINUTILS CCACHE MPFR GMP MPC GDB,$(eval $(call Download,$(p))))
287+
$(foreach p,GCC BINUTILS CCACHE MPFR GMP MPC GDB $(if $(annobin_ver),ANNOBIN),$(eval $(call Download,$(p))))
284288

285289
##########################################################################################
286290
# Unpack RPMS
@@ -360,7 +364,7 @@ endif
360364
##########################################################################################
361365

362366
# Define marker files for each source package to be compiled
363-
$(foreach t,binutils mpfr gmp mpc gcc ccache gdb,$(eval $(t) = $(TARGETDIR)/$($(t)_ver).done))
367+
$(foreach t,binutils mpfr gmp mpc gcc ccache gdb $(if $(annobin_ver),annobin),$(eval $(t) = $(TARGETDIR)/$($(t)_ver).done))
364368

365369
##########################################################################################
366370

@@ -432,6 +436,7 @@ $(gcc) \
432436
$(mpfr) \
433437
$(mpc) \
434438
$(bfdmakes) \
439+
$(if $(annobin_ver),$(annobin)) \
435440
$(ccache) : ENVS += $(TOOLS)
436441

437442
# libdir to work around hateful bfd stuff installing into wrong dirs...
@@ -521,6 +526,28 @@ $(BUILDDIR)/$(mpc_ver)/Makefile \
521526
) 2>&1 | tee $(@D)/log.config
522527
@echo 'done'
523528

529+
ifneq (,$(annobin_ver))
530+
$(BUILDDIR)/$(annobin_ver)/Makefile \
531+
: $(ANNOBIN_CFG)
532+
$(info Configuring $@. Log in $(@D)/log.config)
533+
@mkdir -p $(@D)
534+
( \
535+
cd $(@D) ; \
536+
$(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS) -I$(PREFIX)/include" CXXFLAGS="$(CFLAGS) -I$(PREFIX)/include" \
537+
$(ANNOBIN_CFG) \
538+
$(CONFIG) \
539+
--with-gcc-plugin-dir=$(PREFIX)/lib/gcc/$(TARGET)/$(gcc_ver_only)/plugin \
540+
--without-annocheck \
541+
--without-tests \
542+
--without-docs \
543+
--disable-rpath \
544+
--without-debuginfod \
545+
--without-clang-plugin \
546+
--without-llvm-plugin \
547+
) > $(@D)/log.config 2>&1
548+
@echo 'done'
549+
endif
550+
524551
# Only valid if glibc target -> linux
525552
# proper destructor handling for c++
526553
ifneq (,$(findstring linux,$(TARGET)))
@@ -575,6 +602,10 @@ $(BUILDDIR)/$(gcc_ver)/Makefile : $(gmp) $(mpfr) $(mpc)
575602
$(mpfr) : $(gmp)
576603
$(mpc) : $(gmp) $(mpfr)
577604

605+
ifneq (,$(annobin_ver))
606+
$(annobin) : $(gcc) $(gmp)
607+
endif
608+
578609
################################################################################
579610
# Build gdb but only where host and target match
580611
ifeq ($(HOST), $(TARGET))
@@ -718,10 +749,13 @@ libs : $(libs)
718749
sysroot : rpms libs
719750
gcc : sysroot $(gcc) $(gccpatch)
720751
gdb : $(gdb)
752+
ifneq (,$(annobin_ver))
753+
annobin : $(annobin)
754+
endif
721755
all : binutils gcc bfdlib $(PREFIX)/devkit.info $(missing-links) $(SYSROOT_LINKS) \
722-
$(THESE_MAKEFILES) gdb
756+
$(THESE_MAKEFILES) gdb $(if $(annobin_ver),annobin)
723757

724758
# this is only built for host. so separate.
725759
ccache : $(ccache)
726760

727-
.PHONY : gcc all binutils bfdlib link_libs rpms libs sysroot
761+
.PHONY : gcc all binutils bfdlib link_libs rpms libs sysroot $(if $(annobin_ver),annobin)

0 commit comments

Comments
 (0)