Skip to content

Commit

Permalink
Add support for building on solaris, working around namespace
Browse files Browse the repository at this point in the history
polution problems from system headers.  Patch by Nathan Keynes!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52682 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Jun 24, 2008
1 parent 2b08676 commit 58a4c5e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,10 @@ ifdef UNIVERSAL
DISABLE_AUTO_DEPENDENCIES=1
endif

ifeq ($(OS),SunOS)
CPP.BaseFlags += -include llvm/System/Solaris.h
endif

LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
# All -I flags should go here, so that they don't confuse llvm-config.
Expand Down
40 changes: 40 additions & 0 deletions include/llvm/System/Solaris.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*===- llvm/System/Solaris.h ------------------------------------*- C++ -*-===*
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===*
*
* This file contains portability fixes for Solaris hosts.
*
*===----------------------------------------------------------------------===*/

#ifndef LLVM_SYSTEM_SOLARIS_H
#define LLVM_SYSTEM_SOLARIS_H

#include <sys/types.h>
#include <sys/regset.h>

#undef CS
#undef DS
#undef ES
#undef FS
#undef GS
#undef SS
#undef EAX
#undef ECX
#undef EDX
#undef EBX
#undef ESP
#undef EBP
#undef ESI
#undef EDI
#undef EIP
#undef UESP
#undef EFL
#undef ERR
#undef TRAPNO

#endif
2 changes: 1 addition & 1 deletion utils/GenLibDeps.pl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ sub gen_one_entry {
print " <dt><b>$lib</b</dt><dd><ul>\n";
}
open UNDEFS,
"$nmPath -g -u $Directory/$lib | sed -e 's/^ *U //' | sort | uniq |";
"$nmPath -g -u $Directory/$lib | sed -e 's/^[ 0]* U //' | sort | uniq |";
my %DepLibs;
while (<UNDEFS>) {
chomp;
Expand Down

0 comments on commit 58a4c5e

Please sign in to comment.