Skip to content

Commit cc107a3

Browse files
committed
build: use patch rather than sed in native_cctools package
1 parent 865cb23 commit cc107a3

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

depends/packages/native_cctools.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ $(package)_download_path=https://github.com/tpoechtrager/cctools-port/archive
44
$(package)_file_name=$($(package)_version).tar.gz
55
$(package)_sha256_hash=e51995a843533a3dac155dd0c71362dd471597a2d23f13dff194c6285362f875
66
$(package)_build_subdir=cctools
7+
$(package)_patches=ld64_disable_threading.patch
8+
79
ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
810
$(package)_clang_version=8.0.0
911
$(package)_clang_download_path=https://releases.llvm.org/$($(package)_clang_version)
@@ -78,7 +80,7 @@ endef
7880
define $(package)_preprocess_cmds
7981
CC=$($(package)_cc) CXX=$($(package)_cxx) INSTALLPREFIX=$($(package)_extract_dir) ./libtapi/build.sh && \
8082
CC=$($(package)_cc) CXX=$($(package)_cxx) INSTALLPREFIX=$($(package)_extract_dir) ./libtapi/install.sh && \
81-
sed -i.old "/define HAVE_PTHREADS/d" $($(package)_build_subdir)/ld64/src/ld/InputFiles.h
83+
patch -p1 < $($(package)_patch_dir)/ld64_disable_threading.patch
8284
endef
8385

8486
define $(package)_config_cmds
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
commit 584668415039adeed073decee7e04de28248afd3
2+
Author: fanquake <[email protected]>
3+
Date: Tue Aug 18 01:20:24 2020 +0000
4+
5+
Disable threading to fix non-determinism
6+
7+
A bug in the file parser can cause dependencies to be calculated
8+
differently based on which files have already been parsed. This is more
9+
likely to occur on systems with more CPUs.
10+
11+
Just disable threading for now. There is no noticable slowdown.
12+
13+
See #9891.
14+
15+
diff --git a/cctools/ld64/src/ld/InputFiles.h b/cctools/ld64/src/ld/InputFiles.h
16+
index ef9c756..90a70b6 100644
17+
--- a/cctools/ld64/src/ld/InputFiles.h
18+
+++ b/cctools/ld64/src/ld/InputFiles.h
19+
@@ -25,7 +25,6 @@
20+
#ifndef __INPUT_FILES_H__
21+
#define __INPUT_FILES_H__
22+
23+
-#define HAVE_PTHREADS 1
24+
25+
#include <stdlib.h>
26+
#include <sys/types.h>

0 commit comments

Comments
 (0)