Solved SDCC package seems broken

Hello i am trying to get SDCC compiler working but it seems that binary packet is broken, i install the package with:
pkg install sdcc
But whenIi execute it some times breaks and another shows help, but the 90% of tries it crashes with a core dumped file.
Code:
Garrus # ~> sdcc
Segmentation fault (core dumped)
When it works, it show the help message:
Code:
Garrus # ~> sdcc
SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ez80_z80/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15 4.0.0 #11528 (FreeBSD)
published under GNU General Public License (GPL)
Usage : sdcc [options] filename
Options :-

General options:
      --help                Display this help
  -v  --version             Display sdcc's version
      --verbose             Trace calls to the preprocessor, assembler, and linker
  -V                        Execute verbosely. Show sub commands as they are run
  -d                        Output list of mcaro definitions in effect. Use with -E
  -D                        Define macro as in -Dmacro
  -I                        Add to the include (*.h) path, as in -Ipath
  -A                        
  -U                        Undefine macro as in -Umacro
  -M                        Preprocessor option
  -W                        Pass through options to the pre-processor (p), assembler (a) or linker (l)
  -S                        Compile only; do not assemble or link
  -c  --compile-only        Compile and assemble, but do not link
  -E  --preprocessonly      Preprocess only, do not compile
      --c1mode              Act in c1 mode.  The standard input is preprocessed code, the output is assembly code.
  -o                        Place the output into the given path resp. file
      --print-search-dirs   display the directories in the compiler's search path
      --vc                  messages are compatible with Micro$oft visual studio
      --use-stdout          send errors to stdout instead of stderr
      --nostdlib            Do not include the standard library directory in the search path
      --nostdinc            Do not include the standard include directory in the search path
      --less-pedantic       Disable some of the more pedantic warnings
      --disable-warning     <nnnn> Disable specific warning
      --Werror              Treat the warnings as errors
      --debug               Enable debugging symbol output
      --cyclomatic          Display complexity of compiled functions
      --std-c89             Use ISO C90 (aka ANSI C89) standard (slightly incomplete)
      --std-sdcc89          Use ISO C90 (aka ANSI C89) standard with SDCC extensions
      --std-c95             Use ISO C95 (aka ISO C94) standard (slightly incomplete)
      --std-c99             Use ISO C99 standard (incomplete)
      --std-sdcc99          Use ISO C99 standard with SDCC extensions
      --std-c11             Use ISO C11 standard (incomplete)
      --std-sdcc11          Use ISO C11 standard with SDCC extensions (default)
      --std-c2x             Use ISO C2X standard (incomplete)
      --std-sdcc2x          Use ISO C2X standard with SDCC extensions
      --fdollars-in-identifiers  Permit '$' as an identifier character
      --fsigned-char        Make "char" signed by default
      --use-non-free        Search / include non-free licensed libraries and header files

Code generation options:
  -m                        Set the port to use e.g. -mz80.
  -p                        Select port specific processor e.g. -mpic14 -p16f84
      --stack-auto          Stack automatic variables
      --xstack              Use external stack
      --int-long-reent      Use reentrant calls on the int and long support functions
      --float-reent         Use reentrant calls on the float support functions
      --xram-movc           Use movc instead of movx to read xram (xdata)
      --callee-saves        <func[,func,...]> Cause the called function to save registers instead of the caller
      --profile             On supported ports, generate extra profiling information
      --fomit-frame-pointer  Leave out the frame pointer.
      --all-callee-saves    callee will always save registers used
      --stack-probe         insert call to function __stack_probe at each function prologue
      --no-xinit-opt        don't memcpy initialized xram from code
      --no-c-code-in-asm    don't include c-code as comments in the asm file
      --no-peep-comments    don't include peephole optimizer comments
      --codeseg             <name> use this name for the code segment
      --constseg            <name> use this name for the const segment
      --dataseg             <name> use this name for the data segment

Optimization options:
      --nooverlay           Disable overlaying leaf function auto variables
      --nogcse              Disable the GCSE optimisation
      --nolabelopt          Disable label optimisation
      --noinvariant         Disable optimisation of invariants
      --noinduction         Disable loop variable induction
      --noloopreverse       Disable the loop reverse optimisation
      --no-peep             Disable the peephole assembly file optimisation
      --no-reg-params       On some ports, disable passing some parameters in registers
      --peep-asm            Enable peephole optimization on inline assembly
      --peep-return         Enable peephole optimization for return instructions
      --no-peep-return      Disable peephole optimization for return instructions
      --peep-file           <file> use this extra peephole file
      --opt-code-speed      Optimize for code speed rather than size
      --opt-code-size       Optimize for code size rather than speed
      --max-allocs-per-node  Maximum number of register assignments considered at each node of the tree decomposition
      --nolospre            Disable lospre
      --allow-unsafe-read   Allow optimizations to read any memory location anytime
      --nostdlibcall        Disable optimization of calls to standard library

Internal debugging options:
      --dump-ast            Dump front-end AST before generating i-code
      --dump-i-code         Dump the i-code structure at all stages
      --dump-graphs         Dump graphs (control-flow, conflict, etc)
      --i-code-in-asm       Include i-code as comments in the asm file
      --fverbose-asm        Include code generator comments in the asm output

Linker options:
  -l                        Include the given library in the link
  -L                        Add the next field to the library search path
      --lib-path            <path> use this path to search for libraries
      --out-fmt-ihx         Output in Intel hex format
      --out-fmt-s19         Output in S19 hex format
      --xram-loc            <nnnn> External Ram start location
      --xram-size           <nnnn> External Ram size
      --iram-size           <nnnn> Internal Ram size
      --xstack-loc          <nnnn> External Stack start location
      --code-loc            <nnnn> Code Segment Location
      --code-size           <nnnn> Code Segment size
      --stack-loc           <nnnn> Stack pointer initial value
      --data-loc            <nnnn> Direct data start location
      --idata-loc           
      --no-optsdcc-in-asm   Do not emit .optsdcc in asm

Special options for the mcs51 port:
      --model-small         internal data space is used (default)
      --model-medium        external paged data space is used
      --model-large         external data space is used
      --model-huge          functions are banked, data in external space
      --stack-size          Tells the linker to allocate this space for stack
      --parms-in-bank1      use Bank1 for parameter passing
      --pack-iram           Tells the linker to pack variables in internal ram (default)
      --no-pack-iram        Deprecated: Tells the linker not to pack variables in internal ram
      --acall-ajmp          Use acall/ajmp instead of lcall/ljmp
      --no-ret-without-call  Do not use ret independent of acall/lcall

Special options for the z80 port:
      --callee-saves-bc     Force a called function to always save BC
      --portmode=           Determine PORT I/O mode (z80/z180)
      --asm=                Define assembler name (rgbds/asxxxx/isas/z80asm)
      --codeseg             <name> use this name for the code segment
      --constseg            <name> use this name for the const segment
      --dataseg             <name> use this name for the data segment
      --no-std-crt0         For the z80/gbz80 do not link default crt0.rel
      --reserve-regs-iy     Do not use IY (incompatible with --fomit-frame-pointer)
      --oldralloc           Use old register allocator
      --fno-omit-frame-pointer  Do not omit frame pointer
      --emit-externs        Emit externs list in generated asm

Special options for the z180 port:
      --callee-saves-bc     Force a called function to always save BC
      --portmode=           Determine PORT I/O mode (z80/z180)
      --asm=                Define assembler name (rgbds/asxxxx/isas/z80asm)
      --codeseg             <name> use this name for the code segment
      --constseg            <name> use this name for the const segment
      --dataseg             <name> use this name for the data segment
      --no-std-crt0         For the z80/gbz80 do not link default crt0.rel
      --reserve-regs-iy     Do not use IY (incompatible with --fomit-frame-pointer)
      --oldralloc           Use old register allocator
      --fno-omit-frame-pointer  Do not omit frame pointer
      --emit-externs        Emit externs list in generated asm

Special options for the r2k port:
      --callee-saves-bc     Force a called function to always save BC
      --portmode=           Determine PORT I/O mode (z80/z180)
      --asm=                Define assembler name (rgbds/asxxxx/isas/z80asm)
      --codeseg             <name> use this name for the code segment
      --constseg            <name> use this name for the const segment
      --dataseg             <name> use this name for the data segment
      --no-std-crt0         For the z80/gbz80 do not link default crt0.rel
      --reserve-regs-iy     Do not use IY (incompatible with --fomit-frame-pointer)
      --oldralloc           Use old register allocator
      --fno-omit-frame-pointer  Do not omit frame pointer
      --emit-externs        Emit externs list in generated asm

Special options for the r3ka port:
      --callee-saves-bc     Force a called function to always save BC
      --portmode=           Determine PORT I/O mode (z80/z180)
      --asm=                Define assembler name (rgbds/asxxxx/isas/z80asm)
      --codeseg             <name> use this name for the code segment
      --constseg            <name> use this name for the const segment
      --dataseg             <name> use this name for the data segment
      --no-std-crt0         For the z80/gbz80 do not link default crt0.rel
      --reserve-regs-iy     Do not use IY (incompatible with --fomit-frame-pointer)
      --oldralloc           Use old register allocator
      --fno-omit-frame-pointer  Do not omit frame pointer
      --emit-externs        Emit externs list in generated asm

Special options for the gbz80 port:
      -bo                   <num> use code bank <num>
      -ba                   <num> use data bank <num>
      --callee-saves-bc     Force a called function to always save BC
      --codeseg             <name> use this name for the code segment
      --constseg            <name> use this name for the const segment
      --dataseg             <name> use this name for the data segment
      --no-std-crt0         For the z80/gbz80 do not link default crt0.rel

Special options for the tlcs90 port:
      --callee-saves-bc     Force a called function to always save BC
      --portmode=           Determine PORT I/O mode (z80/z180)
      --asm=                Define assembler name (rgbds/asxxxx/isas/z80asm)
      --codeseg             <name> use this name for the code segment
      --constseg            <name> use this name for the const segment
      --dataseg             <name> use this name for the data segment
      --no-std-crt0         For the z80/gbz80 do not link default crt0.rel
      --reserve-regs-iy     Do not use IY (incompatible with --fomit-frame-pointer)
      --oldralloc           Use old register allocator
      --fno-omit-frame-pointer  Do not omit frame pointer
      --emit-externs        Emit externs list in generated asm

Special options for the ez80_z80 port:
      --callee-saves-bc     Force a called function to always save BC
      --portmode=           Determine PORT I/O mode (z80/z180)
      --asm=                Define assembler name (rgbds/asxxxx/isas/z80asm)
      --codeseg             <name> use this name for the code segment
      --constseg            <name> use this name for the const segment
      --dataseg             <name> use this name for the data segment
      --no-std-crt0         For the z80/gbz80 do not link default crt0.rel
      --reserve-regs-iy     Do not use IY (incompatible with --fomit-frame-pointer)
      --oldralloc           Use old register allocator
      --fno-omit-frame-pointer  Do not omit frame pointer
      --emit-externs        Emit externs list in generated asm

Special options for the ds390 port:
      --model-flat24        use the flat24 model for the ds390 (default)
      --stack-8bit          use the 8bit stack for the ds390 (not supported yet)
      --stack-size          Tells the linker to allocate this space for stack
      --pack-iram           Tells the linker to pack variables in internal ram (default)
      --no-pack-iram        Deprecated: Tells the linker not to pack variables in internal ram
      --stack-10bit         use the 10bit stack for ds390 (default)
      --use-accelerator     generate code for ds390 arithmetic accelerator
      --protect-sp-update   will disable interrupts during ESP:SP updates
      --parms-in-bank1      use Bank1 for parameter passing

Special options for the pic16 port:
      --pstack-model=       use stack model 'small' (default) or 'large'
  -y  --extended            enable Extended Instruction Set/Literal Offset Addressing mode
      --pno-banksel         do not generate BANKSEL assembler directives
      --obanksel=           set banksel optimization level (default=0 no)
      --denable-peeps       explicit enable of peepholes
      --no-optimize-goto    do NOT use (conditional) BRA instead of GOTO
      --optimize-cmp        try to optimize some compares
      --optimize-df         thoroughly analyze data flow (memory and time intensive!)
      --asm=                Use alternative assembler
      --mplab-comp          enable compatibility mode for MPLAB utilities (MPASM/MPLINK)
      --link=               Use alternative linker
      --preplace-udata-with=  Place udata variables at another section: udata_acs, udata_ovr, udata_shr
      --ivt-loc=            Set address of interrupt vector table.
      --nodefaultlibs       do not link default libraries when linking
      --use-crt=            use <crt-o> run-time initialization module
      --no-crt              do not link any default run-time initialization module
      --debug-xtra          show more debug info in assembly output
      --debug-ralloc        dump register allocator debug file *.d
      --pcode-verbose       dump pcode related info
      --calltree            dump call tree in .calltree file
      --gstack              trace stack pointer push/pop to overflow
      --no-warn-non-free    suppress warning on absent --use-non-free option

Special options for the pic14 port:
      --debug-xtra          show more debug info in assembly output
      --no-pcode-opt        disable (slightly faulty) optimization on pCode
      --stack-size          sets the size if the argument passing stack (default: 16, minimum: 4)
      --no-extended-instructions  forbid use of the extended instruction set (e.g., ADDFSR)
      --no-warn-non-free    suppress warning on absent --use-non-free option

Special options for the TININative port:
      --model-flat24        use the flat24 model for the ds390 (default)
      --stack-8bit          use the 8bit stack for the ds390 (not supported yet)
      --stack-size          Tells the linker to allocate this space for stack
      --pack-iram           Tells the linker to pack variables in internal ram (default)
      --no-pack-iram        Deprecated: Tells the linker not to pack variables in internal ram
      --stack-10bit         use the 10bit stack for ds390 (default)
      --use-accelerator     generate code for ds390 arithmetic accelerator
      --protect-sp-update   will disable interrupts during ESP:SP updates
      --parms-in-bank1      use Bank1 for parameter passing
      --tini-libid          <nnnn> LibraryID used in -mTININative

Special options for the ds400 port:
      --model-flat24        use the flat24 model for the ds400 (default)
      --stack-8bit          use the 8bit stack for the ds400 (not supported yet)
      --stack-size          Tells the linker to allocate this space for stack
      --pack-iram           Tells the linker to pack variables in internal ram (default)
      --no-pack-iram        Deprecated: Tells the linker not to pack variables in internal ram
      --stack-10bit         use the 10bit stack for ds400 (default)
      --use-accelerator     generate code for ds400 arithmetic accelerator
      --protect-sp-update   will disable interrupts during ESP:SP updates
      --parms-in-bank1      use Bank1 for parameter passing

Special options for the hc08 port:
      --model-small         8-bit address space for data
      --model-large         16-bit address space for data (default)
      --out-fmt-elf         Output executable in ELF format
      --oldralloc           Use old register allocator

Special options for the s08 port:
      --model-small         8-bit address space for data
      --model-large         16-bit address space for data (default)
      --out-fmt-elf         Output executable in ELF format
      --oldralloc           Use old register allocator

Special options for the stm8 port:
      --model-medium        16-bit address space for both data and code (default)
      --model-large         16-bit address space for data, 24-bit for code
      --codeseg             <name> use this name for the code segment
      --constseg            <name> use this name for the const segment
      --out-fmt-elf         Output executable in ELF format
Is there any way to debug it to know if its something related to my pc?
Should I try ports version or source code version in SDCC http://sdcc.sourceforge.net/index.php#Download ?
 

SirDice

Administrator
Staff member
Administrator
Moderator
You might want to ask the maintainer if they can update the port. I see a 4.2.0 on the website, the port is still at 4.0.0.
 
OP
kr0m
I have wrote to port mantainer to update, meanwhile i have compiled source code in a test machine and it behaves the same thing, it crashes almost all execution times, thats my compiled version:
test # ~/sdcc> ./bin/sdcc
SDCC : z80/z180/ez80_z80/z80n 4.2.2 #13470 (FreeBSD)
Maybe FreeBSD doesnt work well with that software, the offical supported OS are:
Linux - x86, Microsoft Windows - x86, Microsoft Windows - x86_64 and Mac OS X are the primary, so called "officially supported" platforms.
I have tested under Linuxulator and it works, but i prefer a native compiler without "tricks".
Any idea?
 

SirDice

Administrator
Staff member
Administrator
Moderator
Maybe FreeBSD doesnt work well with that software, the offical supportted OS are
I see absolutely no reason why this specific software couldn't run on FreeBSD. The list of ' officially' supported OSs usually doesn't include FreeBSD, that doesn't mean it's impossible run on FreeBSD.

I'll see if I can test some things. I've got a ton of compilers/assemblers for other 8 bit CPUs already, the Z80 was actually missing from that collection ;)
 
OP
kr0m
I am using the same FreeBSD version, maybe some security option is denying some access, i will try using truss.
Garrus $ ~> uname -a
FreeBSD Garrus.alfaexploit.com 13.0-RELEASE-p11 FreeBSD 13.0-RELEASE-p11 #0: Tue Apr 5 18:54:35 UTC 2022 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
 
OP
kr0m
I have the output of one crash execution and one success execution.
Crash:
Code:
readlink("/etc/malloc.conf",0x7fffff8c0ec0,1024) ERR#2 'No such file or directory'
issetugid()                  = 0 (0x0)
__sysctl("vm.overcommit",2,0x7fffff8bf454,0x7fffff8bf448,0x0,0) = 0 (0x0)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0) = 34410070016 (0x803000000)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12),-1,0x0) = 34416742400 (0x80365d000)
mmap(0x0,4194304,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0) = 34422652928 (0x803c00000)
mprotect(0x59c000,4096,PROT_READ)        = 0 (0x0)
setrlimit(RLIMIT_STACK,{ cur=4194304,max=4194304 }) = 0 (0x0)
SIGNAL 11 (SIGSEGV) code=SEGV_ACCERR trapno=12 addr=0x7fffff8c2238
process killed, signal = 11 (core dumped)
Success:
Code:
readlink("/etc/malloc.conf",0x7fffffee3190,1024) ERR#2 'No such file or directory'
issetugid()                  = 0 (0x0)
__sysctl("vm.overcommit",2,0x7fffffee1724,0x7fffffee1718,0x0,0) = 0 (0x0)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0) = 34414264320 (0x803400000)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12),-1,0x0) = 34416893952 (0x803682000)
mmap(0x0,4194304,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0) = 34431041536 (0x804400000)
mprotect(0x59c000,4096,PROT_READ)        = 0 (0x0)
setrlimit(RLIMIT_STACK,{ cur=4194304,max=4194304 }) = 0 (0x0)
sigaction(SIGABRT,{ 0x2e2670 SA_RESTART ss_t },{ SIG_DFL SA_RESETHAND ss_t }) = 0 (0x0)
sigaction(SIGTERM,{ 0x2e2670 SA_RESTART ss_t },{ SIG_DFL 0x0 ss_t }) = 0 (0x0)
sigaction(SIGINT,{ 0x2e2670 SA_RESTART ss_t },{ SIG_DFL 0x0 ss_t }) = 0 (0x0)
sigaction(SIGSEGV,{ 0x2e2670 SA_RESTART ss_t },{ SIG_DFL SA_RESETHAND ss_t }) = 0 (0x0)
access("/root/.opam/4.13.1/bin/sdcc",X_OK)   ERR#2 'No such file or directory'
access("/sbin/sdcc",X_OK)            ERR#2 'No such file or directory'
access("/bin/sdcc",X_OK)             ERR#2 'No such file or directory'
access("/usr/sbin/sdcc",X_OK)            ERR#2 'No such file or directory'
access("/usr/bin/sdcc",X_OK)             ERR#2 'No such file or directory'
access("/usr/local/sbin/sdcc",X_OK)      ERR#2 'No such file or directory'
access("/usr/local/bin/sdcc",X_OK)       = 0 (0x0)
access("/root/.opam/4.13.1/bin/sdcc",X_OK)   ERR#2 'No such file or directory'
access("/sbin/sdcc",X_OK)            ERR#2 'No such file or directory'
access("/bin/sdcc",X_OK)             ERR#2 'No such file or directory'
access("/usr/sbin/sdcc",X_OK)            ERR#2 'No such file or directory'
access("/usr/bin/sdcc",X_OK)             ERR#2 'No such file or directory'
access("/usr/local/sbin/sdcc",X_OK)      ERR#2 'No such file or directory'
access("/usr/local/bin/sdcc",X_OK)       = 0 (0x0)
SDCC : write(2,"SDCC : ",7)              = 7 (0x7)
mcs51write(2,"mcs51",5)              = 5 (0x5)
/z80write(2,"/z80",4)                = 4 (0x4)
/z180write(2,"/z180",5)              = 5 (0x5)
/r2kwrite(2,"/r2k",4)                = 4 (0x4)
/r3kawrite(2,"/r3ka",5)              = 5 (0x5)
/gbz80write(2,"/gbz80",6)                = 6 (0x6)
/tlcs90write(2,"/tlcs90",7)              = 7 (0x7)
/ez80_z80write(2,"/ez80_z80",9)              = 9 (0x9)
/ds390write(2,"/ds390",6)                = 6 (0x6)
/pic16write(2,"/pic16",6)                = 6 (0x6)
/pic14write(2,"/pic14",6)                = 6 (0x6)
/TININativewrite(2,"/TININative",11)             = 11 (0xb)
/ds400write(2,"/ds400",6)                = 6 (0x6)
/hc08write(2,"/hc08",5)              = 5 (0x5)
/s08write(2,"/s08",4)                = 4 (0x4)
/stm8write(2,"/stm8",5)              = 5 (0x5)
/pdk13write(2,"/pdk13",6)                = 6 (0x6)
/pdk14write(2,"/pdk14",6)                = 6 (0x6)
/pdk15write(2,"/pdk15",6)                = 6 (0x6)
 4.0.0 #11528 (FreeBSD)
write(2," 4.0.0 #11528 (FreeBSD)\n",24)      = 24 (0x18)
published under GNU General Public License (GPL)
write(2,"published under GNU General Publ"...,49) = 49 (0x31)
Usage : sdcc [options] filename
Options :-
write(2,"Usage : sdcc [options] filename"...,43) = 43 (0x2b)

I think that the key is:
Code:
setrlimit(RLIMIT_STACK,{ cur=4194304,max=4194304 }) = 0 (0x0)
SIGNAL 11 (SIGSEGV) code=SEGV_ACCERR trapno=12 addr=0x7fffff8c2238
Code:
setrlimit(RLIMIT_STACK,{ cur=4194304,max=4194304 }) = 0 (0x0)
sigaction(SIGABRT,{ 0x2e2670 SA_RESTART ss_t },{ SIG_DFL SA_RESETHAND ss_t }) = 0 (0x0)

I will investigate about setrlimit syscall
 

SirDice

Administrator
Staff member
Administrator
Moderator
I now have it installed on a 13.0-RELEASE machine. Ran sdcc several times in a row, not once did it crash. The biggest difference I see is that I built lang/sdcc on my own package repository. I need to try the package from the official repository.

_Darius_ Is it possible the source picks up on CPU features during the build? The official packages are built on relatively new hardware, that might enable certain CPU features. If you run that code on a CPU that doesn't have these features it's going to crash. I'm thinking AVX, SSE, etc. might be possible issue.

kr0m can you try building lang/sdcc from ports? If there are issues with CPU features, building it on your own system should eliminate this potential incompatibility.
 
OP
kr0m
I will try to build, but i am not very confident with FreeBSD systems, i am using binary packages for all the installed software in the system, if i mix some packages from binary and others from ports will i get in troubles?
When a port asks to compile some library dependencies, that dependency port will sustitute my binary installed library?
In that case the binary sofware can be confused about installed libraries and expected ones?
 
OP
kr0m
Sorry _Darius_ i didnt readed you, you are right the problem is related with ASLR, i have set:
elfctl -e +noaslrstkgap /usr/local/bin/sdcc

And it works 100% of times, thank you very much.
 

SirDice

Administrator
Staff member
Administrator
Moderator
I will try to build, but i am not very confident with FreeBSD systems, i am using binary packages for all the installed software in the system, if i mix some packages from binary and others from ports will i get in troubles?
Not if we're careful. In this specific case we can guide you through the process.

And it works 100% of times, thank you very much.
So much for my theory. No need to build the port in that case ;)

If you don't mind me asking, where are you going to use sdcc for? I'm familiar with the old 8051, did some assembler on it a long time ago. I've also done 6502/6510, 6809 and 680x0 assembler. Recently revived my old school 8 bit knowledge and built my own 6502 based SBC. The Z80 is on my list of CPUs to play with next. Didn't know sdcc, so thanks for bringing it to my attention.
 
Sorry _Darius_ i didnt readed you, you are right the problem is related with ASLR, i have set:


And it works 100% of times, thank you very much.
Great, I am not sure exactly what version has the ASLR stack gap fixed but this should be a useful stop gap for now.
 
OP
kr0m
Not if we're careful. In this specific case we can guide you through the process.


So much for my theory. No need to build the port in that case ;)

If you don't mind me asking, where are you going to use sdcc for? I'm familiar with the old 8051, did some assembler on it a long time ago. I've also done 6502/6510, 6809 and 680x0 assembler. Recently revived my old school 8 bit knowledge and built my own 6502 based SBC. The Z80 is on my list of CPUs to play with next. Didn't know sdcc, so thanks for bringing it to my attention.
I am coding a GameBoy game, only for learning something new :)


As SDCC compiler works as expected after disabling ASLR for the binary, i close the thread as resolved, thank you guys for the assistance and help.
 
Top