As per suggestion we should use g0 for turning off debug information in the compiled go file.
I did some preparatory work in case we will add more levels in the future as well.
See diff attached.
>>>>>>>>>>>>>>>>>>>>< address@hidden:~/guile-work$ guile/meta/guild compile --help
Usage: compile [OPTION] FILE...
Compile each Guile source file FILE into a Guile object.
-h, --help print this help message
-L, --load-path=DIR add DIR to the front of the module load path
-o, --output=OFILE write output to OFILE
-W, --warn=WARNING emit warnings of type WARNING; use `--warn=help'
for a list of available warnings
-O, --optimize=OPT specify optimization passes to run; use `-Ohelp'
for a list of available optimizations
-g, --debug=OPT specify debug information availability; use `-ghelp
'
for a list of available debug options
-f, --from=LANG specify a source language other than `scheme'
-t, --to=LANG specify a target language other than `bytecode'
-T, --target=TRIPLET produce bytecode for host TRIPLET
Note that auto-compilation will be turned off.
Report bugs to <address@hidden>.
>>>>>>>>>>>>>>>>>> address@hidden:~/guile-work$ guile/meta/guild compile -g0 test.scm
wrote `/home/stis/guile-work/guile/cache/guile/ccache/2.2-LE-8-3.A/home/st
is/guile-work/test.scm.go'
address@hidden:~/guile-work$ objdump -h ~/guile-work/guile/cache/guile/ccach
e/2.2-LE-8-3.A/home/stis/guile-work/test.scm.go
/home/stis/guile-work/guile/cache/guile/ccache/2.2-LE-8-3.A/home/stis/guil
e-work/test.scm.go: file format elf64-little
Sections:
Idx Name Size VMA LMA File off
Algn
0 .guile.procprops 00000000 0000000000000000 0000000000000000 0001041
8 2**3
CONTENTS, READONLY
1 .rodata 00000013 0000000000000138 0000000000000138 00000138
2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .data 00000028 0000000000010000 0000000000010000 00010000
2**3
CONTENTS, ALLOC, LOAD, DATA
3 .rtl-text 00000050 00000000000000e8 00000000000000e8 000000e8
2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .dynamic 00000060 0000000000000150 0000000000000150 00000150
2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .guile.arities 0000002f 0000000000000000 0000000000000000 000103e8
2**3
CONTENTS, READONLY
6 .guile.arities.strtab 00000016 0000000000000000 0000000000000000 00
010450 2**3
CONTENTS, READONLY
7 .guile.docstrs 00000000 0000000000000000 0000000000000000 00010418
2**3
CONTENTS, READONLY
8 .guile.docstrs.strtab 00000001 0000000000000000 0000000000000000 00
010468 2**3
CONTENTS, READONLY
9 000000e8 0000000000000000 0000000000000000 00000000
2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
10 000003c0 0000000000000000 0000000000000000 00010028
2**3
CONTENTS, READONLY
>>>>>>>>>>>>>>>>>>>>>>>>> address@hidden:~/guile-work$ guile/meta/guild compile -g1 test.scm
wrote `/home/stis/guile-work/guile/cache/guile/ccache/2.2-LE-8-3.A/home/st
is/guile-work/test.scm.go'
address@hidden:~/guile-work$ objdump -h ~/guile-work/guile/cache/guile/ccach
e/2.2-LE-8-3.A/home/stis/guile-work/test.scm.go
/home/stis/guile-work/guile/cache/guile/ccache/2.2-LE-8-3.A/home/stis/guil
e-work/test.scm.go: file format elf64-little
Sections:
Idx Name Size VMA LMA File off
Algn
0 .guile.procprops 00000000 0000000000000000 0000000000000000 0001055
8 2**3
CONTENTS, READONLY
1 .rodata 00000013 0000000000000138 0000000000000138 00000138
2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .data 00000028 0000000000010000 0000000000010000 00010000
2**3
CONTENTS, ALLOC, LOAD, DATA
3 .rtl-text 00000050 00000000000000e8 00000000000000e8 000000e8
2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .dynamic 00000060 0000000000000150 0000000000000150 00000150
2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .guile.arities 0000002f 0000000000000000 0000000000000000 00010528
2**3
CONTENTS, READONLY
6 .guile.arities.strtab 00000016 0000000000000000 0000000000000000 00
010640 2**3
CONTENTS, READONLY
7 .guile.docstrs 00000000 0000000000000000 0000000000000000 00010558
2**3
CONTENTS, READONLY
8 .guile.docstrs.strtab 00000001 0000000000000000 0000000000000000 00
010658 2**3
CONTENTS, READONLY
9 .debug_info 00000034 0000000000000000 0000000000000000 00010558
2**3
CONTENTS, READONLY, DEBUGGING
10 .debug_abbrev 00000019 0000000000000000 0000000000000000 00010590
2**3
CONTENTS, READONLY, DEBUGGING
11 .debug_str 00000014 0000000000000000 0000000000000000 000105b0
2**3
CONTENTS, READONLY, DEBUGGING
12 .debug_loc 00000000 0000000000000000 0000000000000000 000105c8
2**3
CONTENTS, READONLY, DEBUGGING
13 .debug_line 00000039 0000000000000000 0000000000000000 000105c8
2**3
CONTENTS, READONLY, DEBUGGING
14 000000e8 0000000000000000 0000000000000000 00000000
2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
15 00000500 0000000000000000 0000000000000000 00010028
2**3
CONTENTS, READONLY
>>>>>>>>>>>>>>>>>>> address@hidden:~/guile-work$ guile/meta/guild compile -ghelp
The available debug options are:
-gdebug-info
To disable an optimization, prepend it with `no-', for example
`-gno-debug-info'
You may also specify optimization levels as `-g0', `-g1'.
Currently `-g0' removes debug info from the compiled file
and remove all debug information,
`-g1' have all debug info inserted in the compiled file.
The default is equivalent to `-g1'.