Changeset 455a7d5 for driver


Ignore:
Timestamp:
Aug 9, 2018, 6:35:02 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
ea5b7d6
Parents:
fb975a50 (diff), 0c827019 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into jenkins-sandbox

Location:
driver
Files:
1 added
4 moved

Legend:

Unmodified
Added
Removed
  • driver/Makefile.am

    rfb975a50 r455a7d5  
    1111## Created On       : Sun May 31 08:49:31 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Apr 30 17:44:17 2018
    14 ## Update Count     : 11
     13## Last Modified On : Thu Aug  2 12:18:25 2018
     14## Update Count     : 14
    1515###############################################################################
    1616
    1717# applies to both programs
    1818AM_CXXFLAGS = -Wall -O2 -g -std=c++14 -I${abs_top_srcdir}/src
    19 if BUILD_NO_LIB
    20 else
    21 AM_CXXFLAGS += -DHAVE_LIBCFA
    22 endif
    23 if BUILD_DEBUG
    24 AM_CXXFLAGS += -DHAVE_LIBCFA_DEBUG
    25 endif
    26 if BUILD_RELEASE
    27 AM_CXXFLAGS += -DHAVE_LIBCFA_RELEASE
    28 endif
    2919
    3020# don't install cfa directly
     
    4535# put into lib for now
    4636cc1libdir = ${CFA_LIBDIR}
    47 cc1lib_PROGRAMS = cc1
     37cc1lib_PROGRAMS = as cc1
     38as_SOURCES = as.cc
    4839cc1_SOURCES = cc1.cc
    4940
  • driver/Makefile.in

    rfb975a50 r455a7d5  
    9292build_triplet = @build@
    9393host_triplet = @host@
    94 @BUILD_NO_LIB_FALSE@am__append_1 = -DHAVE_LIBCFA
    95 @BUILD_DEBUG_TRUE@am__append_2 = -DHAVE_LIBCFA_DEBUG
    96 @BUILD_RELEASE_TRUE@am__append_3 = -DHAVE_LIBCFA_RELEASE
    9794noinst_PROGRAMS = cfa$(EXEEXT)
    98 cc1lib_PROGRAMS = cc1$(EXEEXT)
    99 subdir = src/driver
     95cc1lib_PROGRAMS = as$(EXEEXT) cc1$(EXEEXT)
     96subdir = driver
    10097ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    101 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
     98am__aclocal_m4_deps = $(top_srcdir)/automake/cfa.m4 \
     99        $(top_srcdir)/configure.ac
    102100am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    103101        $(ACLOCAL_M4)
     
    109107am__installdirs = "$(DESTDIR)$(cc1libdir)"
    110108PROGRAMS = $(cc1lib_PROGRAMS) $(noinst_PROGRAMS)
     109am_as_OBJECTS = as.$(OBJEXT)
     110as_OBJECTS = $(am_as_OBJECTS)
     111as_LDADD = $(LDADD)
    111112am_cc1_OBJECTS = cc1.$(OBJEXT)
    112113cc1_OBJECTS = $(am_cc1_OBJECTS)
     
    144145am__v_CXXLD_0 = @echo "  CXXLD   " $@;
    145146am__v_CXXLD_1 =
    146 SOURCES = $(cc1_SOURCES) $(cfa_SOURCES)
    147 DIST_SOURCES = $(cc1_SOURCES) $(cfa_SOURCES)
     147SOURCES = $(as_SOURCES) $(cc1_SOURCES) $(cfa_SOURCES)
     148DIST_SOURCES = $(as_SOURCES) $(cc1_SOURCES) $(cfa_SOURCES)
    148149am__can_run_installinfo = \
    149150  case $$AM_UPDATE_INFO_DIR in \
     
    181182AWK = @AWK@
    182183BACKEND_CC = @BACKEND_CC@
     184BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@
    183185CC = @CC@
    184186CCAS = @CCAS@
     
    186188CCASFLAGS = @CCASFLAGS@
    187189CCDEPMODE = @CCDEPMODE@
     190CFACC = @CFACC@
     191CFACPP = @CFACPP@
    188192CFA_BACKEND_CC = @CFA_BACKEND_CC@
    189193CFA_BINDIR = @CFA_BINDIR@
     
    202206DEFS = @DEFS@
    203207DEPDIR = @DEPDIR@
     208DRIVER_DIR = @DRIVER_DIR@
    204209ECHO_C = @ECHO_C@
    205210ECHO_N = @ECHO_N@
     
    217222LEXLIB = @LEXLIB@
    218223LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
     224LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@
     225LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@
    219226LIBOBJS = @LIBOBJS@
    220227LIBS = @LIBS@
    221228LTLIBOBJS = @LTLIBOBJS@
    222 MACHINE_TYPE = @MACHINE_TYPE@
    223229MAKEINFO = @MAKEINFO@
    224230MKDIR_P = @MKDIR_P@
     
    236242SHELL = @SHELL@
    237243STRIP = @STRIP@
     244TARGET_HOSTS = @TARGET_HOSTS@
    238245VERSION = @VERSION@
    239246YACC = @YACC@
     
    293300
    294301# applies to both programs
    295 AM_CXXFLAGS = -Wall -O2 -g -std=c++14 -I${abs_top_srcdir}/src \
    296         $(am__append_1) $(am__append_2) $(am__append_3)
     302AM_CXXFLAGS = -Wall -O2 -g -std=c++14 -I${abs_top_srcdir}/src
    297303cfa_SOURCES = cfa.cc
    298304
    299305# put into lib for now
    300306cc1libdir = ${CFA_LIBDIR}
     307as_SOURCES = as.cc
    301308cc1_SOURCES = cc1.cc
    302309MAINTAINERCLEANFILES = $(CFA_BINDIR)/$(CFA_NAME) @CFA_PREFIX@/lib/${cc1lib_PROGRAMS}
     
    314321          esac; \
    315322        done; \
    316         echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/driver/Makefile'; \
     323        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign driver/Makefile'; \
    317324        $(am__cd) $(top_srcdir) && \
    318           $(AUTOMAKE) --foreign src/driver/Makefile
     325          $(AUTOMAKE) --foreign driver/Makefile
    319326Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
    320327        @case '$?' in \
     
    380387        -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
    381388
     389as$(EXEEXT): $(as_OBJECTS) $(as_DEPENDENCIES) $(EXTRA_as_DEPENDENCIES)
     390        @rm -f as$(EXEEXT)
     391        $(AM_V_CXXLD)$(CXXLINK) $(as_OBJECTS) $(as_LDADD) $(LIBS)
     392
    382393cc1$(EXEEXT): $(cc1_OBJECTS) $(cc1_DEPENDENCIES) $(EXTRA_cc1_DEPENDENCIES)
    383394        @rm -f cc1$(EXEEXT)
     
    394405        -rm -f *.tab.c
    395406
     407@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/as.Po@am__quote@
    396408@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cc1.Po@am__quote@
    397409@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfa.Po@am__quote@
  • driver/cfa.cc

    rfb975a50 r455a7d5  
    2121#include <string.h>                                                                             // strcmp
    2222
     23#include <sys/types.h>
     24#include <sys/stat.h>
     25
    2326#include "Common/SemanticError.h"
    2427#include "config.h"                                                                             // configure info
     
    6669} // shuffle
    6770
     71static inline bool dirExists(const string & path) {
     72    struct stat info;
     73    if(stat( path.c_str(), &info ) != 0)
     74        return false;
     75    else if(info.st_mode & S_IFDIR)
     76        return true;
     77    else
     78        return false;
     79} //dirExists
     80
    6881
    6982#define str(s) #s
     
    7386        string Major( str( CFA_VERSION_MAJOR ) ), Minor( str( CFA_VERSION_MINOR ) ), Patch( str( CFA_VERSION_PATCH ) );
    7487
    75         string installincdir( CFA_INCDIR );                                     // fixed location of include files
    76         string installlibdir( CFA_LIBDIR );                                     // fixed location of cc1 and cfa-cpp commands
     88        string installincdir( CFA_INCDIR );                         // fixed location of include files
     89        string installlibdir( CFA_LIBDIR );                         // fixed location of cc1 and cfa-cpp commands when installed
     90        string srcdriverdir ( TOP_BUILDDIR "driver");                // fixed location of cc1 and cfa-cpp commands when in tree
    7791
    7892        string heading;                                                                         // banner printed at start of cfa compilation
     
    96110        bool xflag = false;                                                                     // user supplied -x flag
    97111        bool debugging __attribute(( unused )) = false;         // -g flag
     112        bool m32 = false;                                    // -m32 flag
     113        bool m64 = false;                                    // -m64 flag
     114        bool intree = false;
    98115
    99116        const char *args[argc + 100];                                           // cfa command line values, plus some space for additional flags
     
    154171                        } else if ( arg == "-no-include-stdhdr" ) {
    155172                                noincstd_flag = true;                                   // strip the no-include-stdhdr flag
     173                        } else if ( arg == "-in-tree" ) {
     174                                intree = true;
    156175                        } else if ( arg == "-compiler" ) {
    157176                                // use the user specified compiler
     
    258277                                libs[nlibs] = argv[i];
    259278                                nlibs += 1;
     279                        } else if ( arg == "-m32" ) {
     280                                m32 = true;
     281                                m64 = false;
     282                                args[nargs] = argv[i];
     283                                nargs += 1;
     284                        } else if ( arg == "-m64" ) {
     285                                m64 = true;
     286                                m32 = false;
     287                                args[nargs] = argv[i];
     288                                nargs += 1;
    260289                        } else {
    261290                                // concatenate any other arguments
     
    309338
    310339        // add the CFA include-library paths, which allow direct access to header files without directory qualification
    311         args[nargs] = "-I" CFA_INCDIR;
    312         nargs += 1;
    313         if ( ! noincstd_flag ) {                                                        // do not use during build
    314                 args[nargs] = "-I" CFA_INCDIR "/stdhdr";
    315                 nargs += 1;
    316         } // if
    317         args[nargs] = "-I" CFA_INCDIR "/concurrency";
    318         nargs += 1;
    319         args[nargs] = "-I" CFA_INCDIR "/containers";
    320         nargs += 1;
    321 
    322         #ifdef HAVE_LIBCFA
     340        if( !intree ) {
     341                args[nargs] = "-I" CFA_INCDIR;
     342                nargs += 1;
     343                if ( ! noincstd_flag ) {                                                        // do not use during build
     344                        args[nargs] = "-I" CFA_INCDIR "/stdhdr";
     345                        nargs += 1;
     346                } // if
     347                args[nargs] = "-I" CFA_INCDIR "/concurrency";
     348                nargs += 1;
     349                args[nargs] = "-I" CFA_INCDIR "/containers";
     350                nargs += 1;
     351        } else {
     352                args[nargs] = "-I" TOP_SRCDIR "libcfa/src";
     353                nargs += 1;
     354                if ( ! noincstd_flag ) {                                                        // do not use during build
     355                        args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/stdhdr";
     356                        nargs += 1;
     357                } // if
     358                args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/concurrency";
     359                nargs += 1;
     360                args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/containers";
     361                nargs += 1;
     362        }
     363
     364        string libbase;
     365        if( !intree ) {
     366                libbase = CFA_LIBDIR;
     367        } else {
     368                libbase = TOP_BUILDDIR "libcfa/";
     369                args[nargs] = "-D__CFA_FLAG__=-t";
     370                nargs += 1;
     371        }
     372
     373        const char * const arch = m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU);
     374        const char * config = debug ? "debug": "nodebug";
     375        string libdir = libbase + arch + "-" + config;
     376        if( !dirExists(libdir) ) {
     377                cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl;
     378                cerr << "Was looking for " << libdir << endl;
     379                libdir = libbase + arch + "-" + "nolib";
     380        }
     381
     382        if( !dirExists(libdir) ) {
     383                cerr << argv[0] << " internal error, cannot find prelude directory." << endl;
     384                cerr << "Was looking for " << libdir << endl;
     385                exit( EXIT_FAILURE );
     386        }
     387
     388        args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir + (intree ? "/prelude" : "")) ).c_str();
     389        nargs += 1;
     390
    323391        if ( link ) {
    324                 #if ! defined(HAVE_LIBCFA_RELEASE)
    325                 if ( ! debug ) {
    326                         cerr << "error: Option -nodebug is unavailable, libcfa was not installed." << endl;
    327                         exit( EXIT_FAILURE );
    328                 } // if
    329                 #endif
    330                 #if ! defined(HAVE_LIBCFA_DEBUG)
    331                 if ( debug ) {
    332                         cerr << "error: Option -debug is unavailable, libcfa-d was not installed." << endl;
    333                         exit( EXIT_FAILURE );
    334                 } // if
    335                 #endif
    336 
    337392                args[nargs] = "-Xlinker";
    338393                nargs += 1;
     
    347402                args[nargs] = "--undefined=__cfaabi_appready_startup";
    348403                nargs += 1;
     404                args[nargs] = "-Xlinker";
     405                nargs += 1;
     406                args[nargs] = "--undefined=__cfaabi_dbg_record";
     407                nargs += 1;
    349408
    350409                // include the cfa library in case it's needed
    351                 args[nargs] = "-L" CFA_LIBDIR;
    352                 nargs += 1;
    353                 if ( debug ) {
    354                         args[nargs] = "-lcfa-d";
    355                 } else {
    356                         args[nargs] = "-lcfa";
    357                 } // if
     410                args[nargs] = ( *new string( string("-L" ) + libdir + (intree ? "/src" : "")) ).c_str();
     411                nargs += 1;
     412                args[nargs] = "-lcfa";
    358413                nargs += 1;
    359414                args[nargs] = "-lpthread";
     
    364419                nargs += 1;
    365420        } // if
    366         #endif // HAVE_LIBCFA
    367421
    368422        // Add exception flags (unconditionally)
     
    410464
    411465        if ( Bprefix.length() == 0 ) {
    412                 Bprefix = installlibdir;
     466                Bprefix = !intree ? installlibdir : srcdriverdir;
    413467                args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str();
    414468                nargs += 1;
    415469        } // if
    416470
    417     args[nargs] = "-Xlinker";                                                   // used by backtrace
    418     nargs += 1;
    419     args[nargs] = "-export-dynamic";
    420     nargs += 1;
     471        args[nargs] = "-Xlinker";                                                       // used by backtrace
     472        nargs += 1;
     473        args[nargs] = "-export-dynamic";
     474        nargs += 1;
    421475
    422476        // execute the compilation command
Note: See TracChangeset for help on using the changeset viewer.