mirror of https://github.com/Shizmob/smol
rename --loader-dir to --smol-loader-dir
This commit is contained in:
parent
498df344a6
commit
b4e39ac8fc
|
@ -39,7 +39,7 @@ Possible `smol-opt`s:
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: smold [-h] [-m TARGET] [-l LIB] [-L DIR] [--smol-opt OPT]
|
usage: smold [-h] [-m TARGET] [-l LIB] [-L DIR] [--smol-opt OPT]
|
||||||
[--loader-dir LOADER_DIR] [--nasm NASM] [--ld LD] [--cc CC]
|
[--smol-loader-dir DIR] [--nasm NASM] [--ld LD] [--cc CC]
|
||||||
[--scanelf SCANELF] [--readelf READELF] [-o OUT]
|
[--scanelf SCANELF] [--readelf READELF] [-o OUT]
|
||||||
input [input ...]
|
input [input ...]
|
||||||
|
|
||||||
|
@ -54,8 +54,8 @@ optional arguments:
|
||||||
libraries to link against
|
libraries to link against
|
||||||
-L DIR, --libdir DIR directories to search libraries in
|
-L DIR, --libdir DIR directories to search libraries in
|
||||||
--smol-opt OPT optimization flags for smol
|
--smol-opt OPT optimization flags for smol
|
||||||
--loader-dir LOADER_DIR
|
--smol-loader-dir DIR
|
||||||
path to loader files
|
path to smol loader files
|
||||||
--nasm NASM which nasm binary to use
|
--nasm NASM which nasm binary to use
|
||||||
--ld LD which ld binary to use
|
--ld LD which ld binary to use
|
||||||
--cc CC which cc binary to use
|
--cc CC which cc binary to use
|
||||||
|
|
9
smold
9
smold
|
@ -24,8 +24,9 @@ def main():
|
||||||
|
|
||||||
parser.add_argument('--smol-opt', metavar='OPT', default=['use_interp'], action='append',
|
parser.add_argument('--smol-opt', metavar='OPT', default=['use_interp'], action='append',
|
||||||
help='optimization flags for smol')
|
help='optimization flags for smol')
|
||||||
parser.add_argument('--loader-dir', default=path.join(path.dirname(__file__), 'ldr'),
|
parser.add_argument('--smol-loader-dir', metavar='DIR',
|
||||||
help='path to loader files')
|
default=path.join(path.dirname(__file__), 'ldr'), help='path to smol loader files')
|
||||||
|
|
||||||
parser.add_argument('--nasm', default=os.getenv('NASM') or shutil.which('nasm'),
|
parser.add_argument('--nasm', default=os.getenv('NASM') or shutil.which('nasm'),
|
||||||
help='which nasm binary to use')
|
help='which nasm binary to use')
|
||||||
parser.add_argument('--ld', default=os.getenv('LD') or shutil.which('ld'),
|
parser.add_argument('--ld', default=os.getenv('LD') or shutil.which('ld'),
|
||||||
|
@ -91,8 +92,8 @@ def main():
|
||||||
output_table(arch, symbols, table)
|
output_table(arch, symbols, table)
|
||||||
table.flush()
|
table.flush()
|
||||||
try:
|
try:
|
||||||
subprocess.check_call([args.nasm] + as_args + ['-I', args.loader_dir + '/', '-f', 'elf{}'.format(bits), table.name, '-o', tableobj.name])
|
subprocess.check_call([args.nasm] + as_args + ['-I', args.smol_loader_dir + '/', '-f', 'elf{}'.format(bits), table.name, '-o', tableobj.name])
|
||||||
subprocess.check_call([args.ld, '-T', os.path.join(args.loader_dir, 'link.ld'), '--oformat=binary', '-o', args.output, tableobj.name] + ld_args + args.input)
|
subprocess.check_call([args.ld, '-T', os.path.join(args.smol_loader_dir, 'link.ld'), '--oformat=binary', '-o', args.output, tableobj.name] + ld_args + args.input)
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue