Skip to content

Commit

Permalink
patch for __alloca missing on ubuntu 18.04 (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
osresearch committed Sep 18, 2018
1 parent bec3335 commit 292a8be
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 22 deletions.
52 changes: 32 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ CPUS := $(shell nproc)
# Create the log directory if it doesn't already exist
BUILD_LOG := $(shell mkdir -p "$(log_dir)" )

WGET ?= wget

# Check that we have a correct version of make
# that matches at least the major version
LOCAL_MAKE_VERSION := $(shell $(MAKE) --version | head -1 | cut -d' ' -f3)
Expand Down Expand Up @@ -230,10 +232,10 @@ define define_module =
# wget creates it early, so we have to cleanup if it fails
$(packages)/$($1_tar):
$(call do,WGET,$($1_url),\
if ! wget -O "$$@" $($1_url) ; then \
rm -f "$$@" ; \
if ! $(WGET) -O "$$@.tmp" $($1_url) ; then \
exit 1 ; \
fi \
fi ; \
mv "$$@.tmp" "$@" \
)
$(packages)/.$1-$($1_version)_verify: $(packages)/$($1_tar)
echo "$($1_hash) $$^" | sha256sum --check -
Expand Down Expand Up @@ -555,30 +557,40 @@ $(eval $(shell echo >&2 "$(DATE) Wrong make detected: $(LOCAL_MAKE_VERSION)"))
HEADS_MAKE := $(build)/$(make_dir)/make

# Once we have a proper Make, we can just pass arguments into it
all bootstrap linux cpio: $(HEADS_MAKE)
all linux cpio run: $(HEADS_MAKE)
LANG=C MAKE=$(HEADS_MAKE) $(HEADS_MAKE) $(MAKE_JOBS) $@
%.clean %.vol: $(HEADS_MAKE)
%.clean %.vol %.menuconfig: $(HEADS_MAKE)
LANG=C MAKE=$(HEADS_MAKE) $(HEADS_MAKE) $@

bootstrap: $(HEADS_MAKE)

# How to download and build the correct version of make
$(HEADS_MAKE): $(build)/$(make_dir)/Makefile
$(packages)/$(make_tar):
$(WGET) -O "$@.tmp" "$(make_url)"
if ! echo "$(make_hash) $@.tmp" | sha256sum --check -; then \
exit 1 ; \
fi
mv "$@.tmp" "$@"

$(build)/$(make_dir)/.extract: $(packages)/$(make_tar)
tar xf "$<" -C "$(build)"
touch "$@"

$(build)/$(make_dir)/.patch: patches/make-$(make_version).patch $(build)/$(make_dir)/.extract
( cd "$(dir $@)" ; patch -p1 ) < "$<"
touch "$@"

$(build)/$(make_dir)/.configured: $(build)/$(make_dir)/.patch
cd "$(dir $@)" ; \
./configure 2>&1 \
| tee "$(log_dir)/make.configure.log" \
$(VERBOSE_REDIRECT)
touch "$@"

$(HEADS_MAKE): $(build)/$(make_dir)/.configured
make -C "$(dir $@)" $(MAKE_JOBS) \
2>&1 \
| tee "$(log_dir)/make.log" \
$(VERBOSE_REDIRECT)

$(build)/$(make_dir)/Makefile: $(packages)/$(make_tar)
tar xf "$<" -C build/
cd "$(dir $@)" ; ./configure \
2>&1 \
| tee "$(log_dir)/make.configure.log" \
$(VERBOSE_REDIRECT)

$(packages)/$(make_tar):
wget -O "$@" "$(make_url)"
if ! echo "$(make_hash) $@" | sha256sum --check -; then \
$(MV) "$@" "$@.failed"; \
false; \
fi

endif
4 changes: 2 additions & 2 deletions modules/make
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# target platform.
#modules += make

make_version := 4.2
make_version := 4.2.1
make_dir := make-$(make_version)
make_tar := make-$(make_version).tar.bz2
make_url := http://gnu.mirror.constant.com/make/$(make_tar)
make_hash := 4e5ce3b62fe5d75ff8db92b7f6df91e476d10c3aceebf1639796dc5bfece655f
make_hash := d6e262bf3601b42d2b1e4ef8310029e1dcf20083c5446b4b7aa67081fdffc589

# This is built for the local machine, not the target, so it doesn't have any
# of the build instructions.
11 changes: 11 additions & 0 deletions patches/make-4.2.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- clean/make-4.2/glob/glob.c 2013-10-20 17:14:38.000000000 +0000
+++ make-4.2/glob/glob.c 2018-09-18 10:16:03.860886356 +0000
@@ -208,7 +208,7 @@
#endif /* __GNU_LIBRARY__ || __DJGPP__ */


-#if !defined __alloca && !defined __GNU_LIBRARY__
+#if !defined __alloca && defined __GNU_LIBRARY__

# ifdef __GNUC__
# undef alloca

0 comments on commit 292a8be

Please sign in to comment.