<commit_before>/*##############################################################################

    Copyright (C) 2011 HPCC Systems.

    All rights reserved. This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
############################################################################## */


#include "platform.h"
#include "jlib.hpp"
#include "jmisc.hpp"
#include "jcomp.hpp"
#include "jsem.hpp"
#include "jexcept.hpp"

#ifdef _WIN32
#include <windows.h>
#include <winbase.h>
#include <io.h>
#else
#include <sys/wait.h>
#endif
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>

#include <stdio.h>

#include "jfile.hpp"
#include "jdebug.hpp"
#include "jcomp.ipp"

#define CC_EXTRA_OPTIONS        ""
#ifdef GENERATE_LISTING
#undef CC_EXTRA_OPTIONS
#define CC_EXTRA_OPTIONS        " /FAs"
#endif

#ifdef _WIN32
#define DEFAULT_COMPILER Vs6CppCompiler
#else
#define DEFAULT_COMPILER GccCppCompiler
#endif

//---------------------------------------------------------------------------

#define BASE_ADDRESS "0x00480000"
//#define BASE_ADDRESS        "0x10000000"

static const char * CC_NAME[] =   { "\"#" PATHSEPSTR "bin" PATHSEPSTR "cl.bat\"",   "\"#" PATHSEPSTR "bin" PATHSEPSTR "g++\"" };
static const char * LINK_NAME[] = { "\"#" PATHSEPSTR "bin" PATHSEPSTR "link.bat\"", "\"#" PATHSEPSTR "bin" PATHSEPSTR "g++\"" };
static const char * LIB_DIR[] = { "\"#\\lib\"", "\"#/lib\"" };
static const char * USE_LIBPATH_FLAG[] = { "/libpath:\"", "-L" };
static const char * USE_LIBPATH_TAIL[] = { "\"", "" };
static const char * USE_LIBRPATH_FLAG[] = { NULL, "-Wl,-rpath -Wl," };
static const char * USE_LIB_FLAG[] = { "", "-l" };
static const char * USE_LIB_TAIL[] = { ".lib", "" };
static const char * USE_INCLUDE_FLAG[] = { "/I\"", "\"-I" };
static const char * USE_DEFINE_FLAG[] = { "/D", "-D" };
static const char * USE_INCLUDE_TAIL[] = { "\"", "\"" };
static const char * INCLUDEPATH[] = { "\"#\\include\"", "\"#/include\"" };
static const char * LINK_SEPARATOR[] = { " /link ", " " };
static const char * OBJECT_FILE_EXT[] = { "obj", "o" };

static const char * LIBFLAG_DEBUG[] = { "/MDd", "" };
static const char * LIBFLAG_RELEASE[] = { "/MD", "" };
static const char * COMPILE_ONLY[] = { "/c", "-c" };

static const char * CC_OPTION_CORE[] = { "", "-fvisibility=hidden -DUSE_VISIBILITY=1" };
static const char * LINK_OPTION_CORE[] = { "/DLL /libpath:." , "" };
static const char * CC_OPTION_DEBUG[] = { "/Zm500 /EHsc /GR /Zi /nologo /bigobj", "-fPIC -pipe -O0" };

static const char * DLL_LINK_OPTION_DEBUG[] = { "/BASE:" BASE_ADDRESS " /NOLOGO /LARGEADDRESSAWARE /INCREMENTAL:NO /DEBUG /DEBUGTYPE:CV", "-g -shared -L. -fPIC -pipe -O0" };
static const char * EXE_LINK_OPTION_DEBUG[] = { "/BASE:" BASE_ADDRESS " /NOLOGO /LARGEADDRESSAWARE /INCREMENTAL:NO /DEBUG /DEBUGTYPE:CV", "-g -L. -Wl,-E -fPIC -pipe -O0" };

static const char * CC_OPTION_RELEASE[] = { "/Zm500 /EHsc /GR /Oi /Ob1 /GF /nologo /bigobj", "-fPIC -pipe -O0" };
<commit_msg>FIX #270 Add -g option to g++ compile step on debug build<commit_after>/*##############################################################################

    Copyright (C) 2011 HPCC Systems.

    All rights reserved. This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
############################################################################## */


#include "platform.h"
#include "jlib.hpp"
#include "jmisc.hpp"
#include "jcomp.hpp"
#include "jsem.hpp"
#include "jexcept.hpp"

#ifdef _WIN32
#include <windows.h>
#include <winbase.h>
#include <io.h>
#else
#include <sys/wait.h>
#endif
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>

#include <stdio.h>

#include "jfile.hpp"
#include "jdebug.hpp"
#include "jcomp.ipp"

#define CC_EXTRA_OPTIONS        ""
#ifdef GENERATE_LISTING
#undef CC_EXTRA_OPTIONS
#define CC_EXTRA_OPTIONS        " /FAs"
#endif

#ifdef _WIN32
#define DEFAULT_COMPILER Vs6CppCompiler
#else
#define DEFAULT_COMPILER GccCppCompiler
#endif

//---------------------------------------------------------------------------

#define BASE_ADDRESS "0x00480000"
//#define BASE_ADDRESS        "0x10000000"

static const char * CC_NAME[] =   { "\"#" PATHSEPSTR "bin" PATHSEPSTR "cl.bat\"",   "\"#" PATHSEPSTR "bin" PATHSEPSTR "g++\"" };
static const char * LINK_NAME[] = { "\"#" PATHSEPSTR "bin" PATHSEPSTR "link.bat\"", "\"#" PATHSEPSTR "bin" PATHSEPSTR "g++\"" };
static const char * LIB_DIR[] = { "\"#\\lib\"", "\"#/lib\"" };
static const char * USE_LIBPATH_FLAG[] = { "/libpath:\"", "-L" };
static const char * USE_LIBPATH_TAIL[] = { "\"", "" };
static const char * USE_LIBRPATH_FLAG[] = { NULL, "-Wl,-rpath -Wl," };
static const char * USE_LIB_FLAG[] = { "", "-l" };
static const char * USE_LIB_TAIL[] = { ".lib", "" };
static const char * USE_INCLUDE_FLAG[] = { "/I\"", "\"-I" };
static const char * USE_DEFINE_FLAG[] = { "/D", "-D" };
static const char * USE_INCLUDE_TAIL[] = { "\"", "\"" };
static const char * INCLUDEPATH[] = { "\"#\\include\"", "\"#/include\"" };
static const char * LINK_SEPARATOR[] = { " /link ", " " };
static const char * OBJECT_FILE_EXT[] = { "obj", "o" };

static const char * LIBFLAG_DEBUG[] = { "/MDd", "" };
static const char * LIBFLAG_RELEASE[] = { "/MD", "" };
static const char * COMPILE_ONLY[] = { "/c", "-c" };

static const char * CC_OPTION_CORE[] = { "", "-fvisibility=hidden -DUSE_VISIBILITY=1" };
static const char * LINK_OPTION_CORE[] = { "/DLL /libpath:." , "" };
static const char * CC_OPTION_DEBUG[] = { "/Zm500 /EHsc /GR /Zi /nologo /bigobj", "-g -fPIC -pipe -O0" };

static const char * DLL_LINK_OPTION_DEBUG[] = { "/BASE:" BASE_ADDRESS " /NOLOGO /LARGEADDRESSAWARE /INCREMENTAL:NO /DEBUG /DEBUGTYPE:CV", "-g -shared -L. -fPIC -pipe -O0" };
static const char * EXE_LINK_OPTION_DEBUG[] = { "/BASE:" BASE_ADDRESS " /NOLOGO /LARGEADDRESSAWARE /INCREMENTAL:NO /DEBUG /DEBUGTYPE:CV", "-g -L. -Wl,-E -fPIC -pipe -O0" };

static const char * CC_OPTION_RELEASE[] = { "/Zm500 /EHsc /GR /Oi /Ob1 /GF /nologo /bigobj", "-fPIC -pipe -O0" };

{'fraction_non_alphanumeric': 0.22384326802834514, 'fraction_numerical': 0.01153258302070307, 'mean_word_length': 3.593490746649649, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6113564', 'n_tokens_mistral': 2537, 'n_tokens_neox': 2438, 'n_words': 722}