Skip to content

Commit

Permalink
From Ed Brash: SCons fixes for interactive interpreter segfaults
Browse files Browse the repository at this point in the history
There are three changes, only one of which probably relates to the
segfault issue:

- Update the ROOT library definition in SConstruct to
  "root-config --glibs" to match Makefile definition.
- Set the -DNDEBUG and -DWITH_DEBUG command line flags
  consistent with Makefile.
- Add -fPIC to g++ command line flags specifically for the
  compilation of src/main.C ... this was not done before, and
  appears to have been the source of the segfault issue.

Closes #141
  • Loading branch information
hansenjo committed Oct 2, 2017
1 parent 92bea3f commit 20cf746
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ except KeyError:
pass # ROOTSYS not defined

try:
baseenv.ParseConfig('$ROOTCONFIG --cflags --libs')
baseenv.ParseConfig('$ROOTCONFIG --cflags --glibs')
if sys.version_info >= (2, 7):
cmd = baseenv['ROOTCONFIG'] + " --cxx"
baseenv.Replace(CXX = subprocess.check_output(cmd, shell=True).rstrip())
Expand Down
2 changes: 1 addition & 1 deletion SDK/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ except KeyError:
pass # ROOTSYS not defined

try:
baseenv.ParseConfig('$ROOTCONFIG --cflags --libs')
baseenv.ParseConfig('$ROOTCONFIG --cflags --glibs')
if sys.version_info >= (2, 7):
cmd = baseenv['ROOTCONFIG'] + " --cxx"
baseenv.Replace(CXX = subprocess.check_output(cmd, shell=True).rstrip())
Expand Down
5 changes: 3 additions & 2 deletions SDK/site_scons/darwin64.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ def config(env,args):

if int(debug):
env.Append(CXXFLAGS = env.Split('-g -O0'))
env.Append(CPPDEFINES= 'WITH_DEBUG')
else:
env.Append(CXXFLAGS = '-O')
env.Append(CPPDEFINES= 'NDEBUG')

env.Append(CPPDEFINES= 'WITH_DEBUG')

if int(standalone):
env.Append(STANDALONE= '1')

Expand All @@ -28,7 +29,7 @@ def config(env,args):
if int(srcdist):
env.Append(SRCDIST= '1')

env.Append(CXXFLAGS = env.Split('-Wall'))
env.Append(CXXFLAGS = env.Split('-Wall -fPIC'))
env.Append(CPPDEFINES = 'MACVERS')

cxxversion = env.subst('$CXXVERSION')
Expand Down
7 changes: 4 additions & 3 deletions SDK/site_scons/linux32.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ def config(env,args):

if int(debug):
env.Append(CXXFLAGS = env.Split('-g -O0'))
env.Append(CPPDEFINES= 'WITH_DEBUG')
else:
env.Append(CXXFLAGS = '-O')
env.Append(CPPDEFINES= 'NDEBUG')

if int(standalone):
env.Append(CPPDEFINES= 'WITH_DEBUG')

if int(standalone):
env.Append(STANDALONE= '1')

if int(cppcheck):
Expand All @@ -28,7 +29,7 @@ def config(env,args):
if int(srcdist):
env.Append(SRCDIST= '1')

env.Append(CXXFLAGS = env.Split('-m32 -Wall'))
env.Append(CXXFLAGS = env.Split('-m32 -Wall -fPIC'))
env.Append(CPPDEFINES = 'LINUXVERS')

cxxversion = env.subst('$CXXVERSION')
Expand Down
5 changes: 3 additions & 2 deletions SDK/site_scons/linux64.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ def config(env,args):

if int(debug):
env.Append(CXXFLAGS = env.Split('-g -O0'))
env.Append(CPPDEFINES= 'WITH_DEBUG')
else:
env.Append(CXXFLAGS = '-O')
env.Append(CPPDEFINES= 'NDEBUG')

env.Append(CPPDEFINES= 'WITH_DEBUG')

if int(standalone):
env.Append(STANDALONE= '1')

Expand All @@ -28,7 +29,7 @@ def config(env,args):
if int(srcdist):
env.Append(SRCDIST= '1')

env.Append(CXXFLAGS = env.Split('-Wall'))
env.Append(CXXFLAGS = env.Split('-Wall -fPIC'))
env.Append(CPPDEFINES = 'LINUXVERS')

cxxversion = env.subst('$CXXVERSION')
Expand Down
5 changes: 3 additions & 2 deletions site_scons/darwin64.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ def config(env,args):

if int(debug):
env.Append(CXXFLAGS = env.Split('-g -O0'))
env.Append(CPPDEFINES= 'WITH_DEBUG')
else:
env.Append(CXXFLAGS = '-O')
env.Append(CPPDEFINES= 'NDEBUG')

env.Append(CPPDEFINES= 'WITH_DEBUG')

if int(standalone):
env.Append(STANDALONE= '1')

Expand All @@ -28,7 +29,7 @@ def config(env,args):
if int(srcdist):
env.Append(SRCDIST= '1')

env.Append(CXXFLAGS = env.Split('-Wall'))
env.Append(CXXFLAGS = env.Split('-Wall -fPIC'))
env.Append(CPPDEFINES = 'MACVERS')

cxxversion = env.subst('$CXXVERSION')
Expand Down
7 changes: 4 additions & 3 deletions site_scons/linux32.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ def config(env,args):

if int(debug):
env.Append(CXXFLAGS = env.Split('-g -O0'))
env.Append(CPPDEFINES= 'WITH_DEBUG')
else:
env.Append(CXXFLAGS = '-O')
env.Append(CPPDEFINES= 'NDEBUG')

if int(standalone):
env.Append(CPPDEFINES= 'WITH_DEBUG')

if int(standalone):
env.Append(STANDALONE= '1')

if int(cppcheck):
Expand All @@ -28,7 +29,7 @@ def config(env,args):
if int(srcdist):
env.Append(SRCDIST= '1')

env.Append(CXXFLAGS = env.Split('-m32 -Wall'))
env.Append(CXXFLAGS = env.Split('-m32 -Wall -fPIC'))
env.Append(CPPDEFINES = 'LINUXVERS')

cxxversion = env.subst('$CXXVERSION')
Expand Down
5 changes: 3 additions & 2 deletions site_scons/linux64.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ def config(env,args):

if int(debug):
env.Append(CXXFLAGS = env.Split('-g -O0'))
env.Append(CPPDEFINES= 'WITH_DEBUG')
else:
env.Append(CXXFLAGS = '-O')
env.Append(CPPDEFINES= 'NDEBUG')

env.Append(CPPDEFINES= 'WITH_DEBUG')

if int(standalone):
env.Append(STANDALONE= '1')

Expand All @@ -28,7 +29,7 @@ def config(env,args):
if int(srcdist):
env.Append(SRCDIST= '1')

env.Append(CXXFLAGS = env.Split('-Wall'))
env.Append(CXXFLAGS = env.Split('-Wall -fPIC'))
env.Append(CPPDEFINES = 'LINUXVERS')

cxxversion = env.subst('$CXXVERSION')
Expand Down

0 comments on commit 20cf746

Please sign in to comment.