Skip to content

Commit 4abba16

Browse files
committed
--- Merging r127239 into '.':
U test/Makefile U Makefile.rules --- Merging r127240 into '.': U utils/llvm-lit/Makefile --- Merging r127726 into '.': U lib/Support/raw_ostream.cpp --- Merging r127730 into '.': U test/CodeGen/X86/dyn-stackalloc.ll llvm-svn: 128259
1 parent 8c6b10a commit 4abba16

File tree

5 files changed

+55
-23
lines changed

5 files changed

+55
-23
lines changed

llvm/Makefile.rules

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,24 @@ BaseNameSources := $(sort $(basename $(Sources)))
719719
ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
720720
ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
721721

722+
#----------------------------------------------------------
723+
# For Mingw MSYS bash and Python/w32:
724+
#
725+
# $(ECHOPATH) prints DOSish pathstring.
726+
# ex) $(ECHOPATH) /include/sys/types.h
727+
# --> C:/mingw/include/sys/types.h
728+
# built-in "echo" does not transform path to DOSish path.
729+
#
730+
# FIXME: It would not be needed when MSYS's python
731+
# were provided.
732+
#----------------------------------------------------------
733+
734+
ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
735+
ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
736+
else
737+
ECHOPATH := $(Verb)$(ECHO)
738+
endif
739+
722740
###############################################################################
723741
# DIRECTORIES: Handle recursive descent of directory structure
724742
###############################################################################

llvm/lib/Support/raw_ostream.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,14 @@ raw_fd_ostream::~raw_fd_ostream() {
496496
}
497497
}
498498

499+
#ifdef __MINGW32__
500+
// On mingw, global dtors should not call exit().
501+
// report_fatal_error() invokes exit(). We know report_fatal_error()
502+
// might not write messages to stderr when any errors were detected
503+
// on FD == 2.
504+
if (FD == 2) return;
505+
#endif
506+
499507
// If there are any pending errors, report them now. Clients wishing
500508
// to avoid report_fatal_error calls should check for errors with
501509
// has_error() and clear the error flag with clear_error() before

llvm/test/CodeGen/X86/dyn-stackalloc.ll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
; RUN: llc < %s -mtriple=i686-linux | not egrep {\\\$4294967289|-7}
2-
; RUN: llc < %s -mtriple=i686-linux | egrep {\\\$4294967280|-16}
3-
; RUN: llc < %s -mtriple=x86_64-linux | grep {\\-16}
1+
; RUN: llc < %s -mtriple=i686-linux | FileCheck %s -check-prefix=X32
2+
; X32-NOT: {{$429496728|-7}}
3+
; X32: {{$4294967280|-16}}
4+
; X32-NOT: {{$429496728|-7}}
5+
; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s -check-prefix=X64
6+
; X64: -16
47

58
define void @t() nounwind {
69
A:

llvm/test/Makefile

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -173,22 +173,24 @@ site.exp: FORCE
173173

174174
lit.site.cfg: site.exp
175175
@echo "Making LLVM 'lit.site.cfg' file..."
176-
@sed -e "s#@LLVM_SOURCE_DIR@#$(LLVM_SRC_ROOT)#g" \
177-
-e "s#@LLVM_BINARY_DIR@#$(LLVM_OBJ_ROOT)#g" \
178-
-e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \
179-
-e "s#@LLVMGCCDIR@#$(LLVMGCCDIR)#g" \
180-
-e "s#@ENABLE_SHARED@#$(ENABLE_SHARED)#g" \
181-
$(PROJ_SRC_DIR)/lit.site.cfg.in > $@
176+
@$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > lit.tmp
177+
@$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
178+
@$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
179+
@$(ECHOPATH) s=@LLVMGCCDIR@=$(LLVMGCCDIR)=g >> lit.tmp
180+
@$(ECHOPATH) s=@PYTHON_EXECUTABLE@=python=g >> lit.tmp
181+
@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp
182+
@sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
183+
@-rm -f lit.tmp
182184

183185
Unit/lit.site.cfg: $(PROJ_OBJ_DIR)/Unit/.dir FORCE
184186
@echo "Making LLVM unittest 'lit.site.cfg' file..."
185-
@sed -e "s#@LLVM_SOURCE_DIR@#$(LLVM_SRC_ROOT)#g" \
186-
-e "s#@LLVM_BINARY_DIR@#$(LLVM_OBJ_ROOT)#g" \
187-
-e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \
188-
-e "s#@LLVMGCCDIR@#$(LLVMGCCDIR)#g" \
189-
-e "s#@LLVM_BUILD_MODE@#$(BuildMode)#g" \
190-
-e "s#@ENABLE_SHARED@#$(ENABLE_SHARED)#g" \
191-
-e "s#@SHLIBDIR@#$(SharedLibDir)#g" \
192-
-e "s#@SHLIBPATH_VAR@#$(SHLIBPATH_VAR)#g" \
193-
$(PROJ_SRC_DIR)/Unit/lit.site.cfg.in > $@
194-
187+
@$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > unit.tmp
188+
@$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> unit.tmp
189+
@$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> unit.tmp
190+
@$(ECHOPATH) s=@LLVMGCCDIR@=$(LLVMGCCDIR)=g >> unit.tmp
191+
@$(ECHOPATH) s=@LLVM_BUILD_MODE@=$(BuildMode)=g >> unit.tmp
192+
@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> unit.tmp
193+
@$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> unit.tmp
194+
@$(ECHOPATH) s=@SHLIBPATH_VAR@=$(SHLIBPATH_VAR)=g >> unit.tmp
195+
@sed -f unit.tmp $(PROJ_SRC_DIR)/Unit/lit.site.cfg.in > $@
196+
@-rm -f unit.tmp

llvm/utils/llvm-lit/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ include $(LEVEL)/Makefile.common
1313

1414
all:: $(ToolDir)/llvm-lit
1515

16-
$(ToolDir)/llvm-lit: llvm-lit.in $(ToolDir)/.dir
16+
$(ToolDir)/llvm-lit: llvm-lit.in Makefile $(ToolDir)/.dir
1717
$(Echo) "Creating 'llvm-lit' script..."
18-
$(Verb)sed -e "s#@LLVM_SOURCE_DIR@#$(LLVM_SRC_ROOT)#g" \
19-
-e "s#@LLVM_BINARY_DIR@#$(LLVM_OBJ_ROOT)#g" \
20-
$< > $@
18+
$(Verb)$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > lit.tmp
19+
$(Verb)$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
20+
$(Verb)sed -f lit.tmp $< > $@
2121
$(Verb)chmod +x $@
22+
$(Verb)rm -f lit.tmp

0 commit comments

Comments
 (0)