Ticket #5739: llvm-cmds.diff

File llvm-cmds.diff, 3.8 KB (added by kgardas, 2 years ago)
  • aclocal.m4

    diff --git a/aclocal.m4 b/aclocal.m4
    index 1d5d1f7..eefe7b9 100644
    a b AC_DEFUN([FP_SETTINGS], 
    377377        SettingsDllWrapCommand="/bin/false" 
    378378        SettingsWindresCommand="/bin/false" 
    379379        SettingsTouchCommand='touch' 
     380        if test -z "$LlcCmd" 
     381        then 
     382          SettingsLlcCommand="llc" 
     383        else 
     384          SettingsLlcCommand="$LlcCmd" 
     385        fi 
     386        if test -z "$OptCmd" 
     387        then 
     388          SettingsOptCommand="opt" 
     389        else 
     390          SettingsOptCommand="$OptCmd" 
     391        fi 
    380392    fi 
    381393    AC_SUBST(SettingsCCompilerCommand) 
    382394    AC_SUBST(SettingsCCompilerFlags) 
    AC_DEFUN([FP_SETTINGS], 
    384396    AC_SUBST(SettingsDllWrapCommand) 
    385397    AC_SUBST(SettingsWindresCommand) 
    386398    AC_SUBST(SettingsTouchCommand) 
     399    AC_SUBST(SettingsLlcCommand) 
     400    AC_SUBST(SettingsOptCommand) 
    387401]) 
    388402 
    389403 
    AC_ARG_WITH($2, 
    545559]) # FP_ARG_WITH_PATH_GNU_PROG 
    546560 
    547561 
     562# FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL 
     563# -------------------- 
     564# XXX 
     565# 
     566# $1 = the variable to set 
     567# $2 = the command to look for 
     568# 
     569AC_DEFUN([FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL], 
     570[ 
     571AC_ARG_WITH($2, 
     572[AC_HELP_STRING([--with-$2=ARG], 
     573        [Use ARG as the path to $2 [default=autodetect]])], 
     574[ 
     575    if test "$HostOS" = "mingw32" 
     576    then 
     577        AC_MSG_WARN([Request to use $withval will be ignored]) 
     578    else 
     579        $1=$withval 
     580    fi 
     581], 
     582[ 
     583    if test "$HostOS" != "mingw32" 
     584    then 
     585        AC_PATH_PROG([$1], [$2]) 
     586    fi 
     587] 
     588) 
     589]) # FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL 
     590 
    548591# FP_PROG_CONTEXT_DIFF 
    549592# -------------------- 
    550593# Figure out how to do context diffs. Sets the output variable ContextDiffCmd. 
  • compiler/main/SysTools.lhs

    diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
    index 23906c6..b666fcd 100644
    a b initSysTools mbMinusB 
    250250                ld_args  = gcc_args 
    251251 
    252252        -- We just assume on command line 
    253         ; let lc_prog = "llc" 
    254               lo_prog = "opt" 
     253        ; lc_prog <- getSetting "LLVM llc command" 
     254        ; lo_prog <- getSetting "LLVM opt command" 
    255255 
    256256        ; return $ Settings { 
    257257                        sTargetPlatform = Platform { 
  • configure.ac

    diff --git a/configure.ac b/configure.ac
    index 8d74707..70633e1 100644
    a b FP_ARG_WITH_PATH_GNU_PROG([NM], [nm]) 
    349349NmCmd="$NM" 
    350350AC_SUBST([NmCmd]) 
    351351 
     352dnl ** Which LLVM llc to use? 
     353dnl -------------------------------------------------------------- 
     354FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL([LLC], [llc]) 
     355LlcCmd="$LLC" 
     356AC_SUBST([LlcCmd]) 
     357 
     358dnl ** Which LLVM opt to use? 
     359dnl -------------------------------------------------------------- 
     360FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL([OPT], [opt]) 
     361OptCmd="$OPT" 
     362AC_SUBST([OptCmd]) 
     363 
    352364dnl ** Mac OS X: explicit deployment target 
    353365dnl -------------------------------------------------------------- 
    354366AC_ARG_WITH([macosx-deployment-target], 
  • mk/config.mk.in

    diff --git a/mk/config.mk.in b/mk/config.mk.in
    index 79e7c6b..8725e6f 100644
    a b DTRACE = @DtraceCmd@ 
    679679LD = @LdCmd@ 
    680680NM = @NmCmd@ 
    681681 
     682LLC = @LlcCmd@ 
     683OPT = @OptCmd@ 
     684 
    682685# Some ld's support the -x flag and some don't, so the configure 
    683686# script detects which we have and sets LdXFlag to "-x" or "" 
    684687# respectively. 
  • settings.in

    diff --git a/settings.in b/settings.in
    index 50062af..7464425 100644
    a b  
    1212 ("target arch", "@HaskellTargetArch@"), 
    1313 ("target has GNU nonexec stack", "@HaskellHaveGnuNonexecStack@"), 
    1414 ("target has .ident directive", "@HaskellHaveIdentDirective@"), 
    15  ("target has subsections via symbols", "@HaskellHaveSubsectionsViaSymbols@") 
     15 ("target has subsections via symbols", "@HaskellHaveSubsectionsViaSymbols@"), 
     16 ("LLVM llc command", "@SettingsLlcCommand@"), 
     17 ("LLVM opt command", "@SettingsOptCommand@") 
    1618 ] 
    1719