Skip to content

Commit 12350c5

Browse files
committed
Simplified SConstruct tools and solved compilation issue
1. Using the `LINKFLAGS=''` instead of the `parse_flags` argument helped with a `-lgcc_s not found` error that prevented linking. 2. The simplification was to only use the necessary tools (not the default toolset). This should hopefully be clearer than the previous iterations. All the executables compile correctly in the container. TODO: check that compilation works on Windows.
1 parent 41498b6 commit 12350c5

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

SConstruct

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ To run the compilation for all implementations in one language, e.g. C, run the
1010
from pathlib import Path
1111
import os
1212

13-
env = Environment(ENV={'PATH': os.environ['PATH']})
13+
env = Environment(ENV={'PATH': os.environ['PATH']},
14+
tools=['gcc', 'gnulink', 'g++'])
1415

15-
env['CC'] = 'gcc'
1616
env['AS'] = 'as'
17-
for tool in ['gcc','gnulink']:
18-
env.Tool(tool)
1917
env['CCFLAGS'] = ''
2018
env['CXXFLAGS'] = '-std=c++17'
2119

contents/cooley_tukey/code/asm-x64/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ from pathlib import Path
33

44
dirname = Path.cwd().parents[1].stem
55

6-
env.X64(f'#/build/asm-x64/{dirname}', Glob('*.s'), LIBS=['m'], parse_flags="-Wl,-no-pie")
6+
env.X64(f'#/build/asm-x64/{dirname}', Glob('*.s'), LIBS=['m'], LINKFLAGS='-no-pie')

contents/forward_euler_method/code/asm-x64/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ from pathlib import Path
33

44
dirname = Path.cwd().parents[1].stem
55

6-
env.X64(f'#/build/asm-x64/{dirname}', Glob('*.s'), LIBS='m', parse_flags="-Wl,-no-pie")
6+
env.X64(f'#/build/asm-x64/{dirname}', Glob('*.s'), LIBS='m', LINKFLAGS='-no-pie')

sconscripts/asm-x64_SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ from pathlib import Path
33

44
for file in files_to_compile:
55
chapter_name = file.parent.parent.parent.stem
6-
env.X64(f'#/build/{language}/{chapter_name}', str(file), parse_flags="-Wl,-no-pie")
6+
env.X64(f'#/build/{language}/{chapter_name}', str(file), LINKFLAGS='-no-pie')

0 commit comments

Comments
 (0)