FB for FreeBSD/powerpc64

Linux specific questions.
lenoil98
Posts: 4
Joined: Feb 16, 2021 0:13
Location: USA

FB for FreeBSD/powerpc64

Postby lenoil98 » Feb 16, 2021 0:24

I'm trying to build FB on FreeBSD/powerpc64. I made changes adding support for powerpc64 and have been able to create a bootstrap compiler that seems to work. However, when trying to build the compiler, I get the below errors when it try to link FBC. It seems that the system cannot find certain files in "/usr/lib".

Any ideas on what I've missed?

Thanks in advance

root@blackbird:/usr/ports/tmp/FreeBASIC-1.07.3-source-bootstrap # gmake
FBC src/compiler/obj/freebsd-powerpc64/ast-gosub.o
FBC src/compiler/obj/freebsd-powerpc64/ast-helper.o
FBC src/compiler/obj/freebsd-powerpc64/ast-misc.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-addr.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-arg.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-assign.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-bop.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-branch.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-call.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-check.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-const.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-conv.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-data.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-decl.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-idx.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-iif.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-macro.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-mem.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-misc.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-proc.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-ptr.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-scope.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-typeini.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-uop.o
FBC src/compiler/obj/freebsd-powerpc64/ast-node-var.o
FBC src/compiler/obj/freebsd-powerpc64/ast-optimize.o
FBC src/compiler/obj/freebsd-powerpc64/ast-vectorize.o
FBC src/compiler/obj/freebsd-powerpc64/ast.o
FBC src/compiler/obj/freebsd-powerpc64/dstr.o
FBC src/compiler/obj/freebsd-powerpc64/edbg_stab.o
FBC src/compiler/obj/freebsd-powerpc64/emit.o
FBC src/compiler/obj/freebsd-powerpc64/emit_SSE.o
FBC src/compiler/obj/freebsd-powerpc64/emit_x86.o
FBC src/compiler/obj/freebsd-powerpc64/error.o
FBC src/compiler/obj/freebsd-powerpc64/fb-main.o
FBC src/compiler/obj/freebsd-powerpc64/fb.o
FBC src/compiler/obj/freebsd-powerpc64/fbc.o
FBC src/compiler/obj/freebsd-powerpc64/flist.o
FBC src/compiler/obj/freebsd-powerpc64/hash.o
FBC src/compiler/obj/freebsd-powerpc64/hlp-str.o
FBC src/compiler/obj/freebsd-powerpc64/hlp.o
FBC src/compiler/obj/freebsd-powerpc64/ir-gas64.o
FBC src/compiler/obj/freebsd-powerpc64/ir-hlc.o
FBC src/compiler/obj/freebsd-powerpc64/ir-llvm.o
FBC src/compiler/obj/freebsd-powerpc64/ir-tac.o
FBC src/compiler/obj/freebsd-powerpc64/ir.o
FBC src/compiler/obj/freebsd-powerpc64/lex-utf.o
FBC src/compiler/obj/freebsd-powerpc64/lex.o
FBC src/compiler/obj/freebsd-powerpc64/list.o
FBC src/compiler/obj/freebsd-powerpc64/objinfo.o
FBC src/compiler/obj/freebsd-powerpc64/parser-assignment.o
FBC src/compiler/obj/freebsd-powerpc64/parser-comment.o
FBC src/compiler/obj/freebsd-powerpc64/parser-compound-do.o
FBC src/compiler/obj/freebsd-powerpc64/parser-compound-extern.o
FBC src/compiler/obj/freebsd-powerpc64/parser-compound-for.o
FBC src/compiler/obj/freebsd-powerpc64/parser-compound-if.o
FBC src/compiler/obj/freebsd-powerpc64/parser-compound-namespace.o
FBC src/compiler/obj/freebsd-powerpc64/parser-compound-scope.o
FBC src/compiler/obj/freebsd-powerpc64/parser-compound-select-const.o
FBC src/compiler/obj/freebsd-powerpc64/parser-compound-select.o
FBC src/compiler/obj/freebsd-powerpc64/parser-compound-while.o
FBC src/compiler/obj/freebsd-powerpc64/parser-compound-with.o
FBC src/compiler/obj/freebsd-powerpc64/parser-compound.o
FBC src/compiler/obj/freebsd-powerpc64/parser-decl-const.o
FBC src/compiler/obj/freebsd-powerpc64/parser-decl-def.o
FBC src/compiler/obj/freebsd-powerpc64/parser-decl-enum.o
FBC src/compiler/obj/freebsd-powerpc64/parser-decl-option.o
FBC src/compiler/obj/freebsd-powerpc64/parser-decl-proc-params.o
FBC src/compiler/obj/freebsd-powerpc64/parser-decl-proc.o
FBC src/compiler/obj/freebsd-powerpc64/parser-decl-struct.o
FBC src/compiler/obj/freebsd-powerpc64/parser-decl-symb-init.o
FBC src/compiler/obj/freebsd-powerpc64/parser-decl-symbtype.o
FBC src/compiler/obj/freebsd-powerpc64/parser-decl-typedef.o
FBC src/compiler/obj/freebsd-powerpc64/parser-decl-var.o
FBC src/compiler/obj/freebsd-powerpc64/parser-decl.o
FBC src/compiler/obj/freebsd-powerpc64/parser-expr-atom.o
FBC src/compiler/obj/freebsd-powerpc64/parser-expr-binary.o
FBC src/compiler/obj/freebsd-powerpc64/parser-expr-constant.o
FBC src/compiler/obj/freebsd-powerpc64/parser-expr-function.o
FBC src/compiler/obj/freebsd-powerpc64/parser-expr-unary.o
FBC src/compiler/obj/freebsd-powerpc64/parser-expr-variable.o
FBC src/compiler/obj/freebsd-powerpc64/parser-identifier.o
FBC src/compiler/obj/freebsd-powerpc64/parser-inlineasm.o
FBC src/compiler/obj/freebsd-powerpc64/parser-label.o
FBC src/compiler/obj/freebsd-powerpc64/parser-proc.o
FBC src/compiler/obj/freebsd-powerpc64/parser-proccall-args.o
FBC src/compiler/obj/freebsd-powerpc64/parser-proccall.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-array.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-casting.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-console.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-data.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-error.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-file.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-gfx.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-goto-return.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-iif.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-math.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-mem.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-on.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-peekpoke.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-string.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-thread.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk-vafirst.o
FBC src/compiler/obj/freebsd-powerpc64/parser-quirk.o
FBC src/compiler/obj/freebsd-powerpc64/parser-statement.o
FBC src/compiler/obj/freebsd-powerpc64/parser-toplevel.o
FBC src/compiler/obj/freebsd-powerpc64/pool.o
FBC src/compiler/obj/freebsd-powerpc64/pp-cond.o
FBC src/compiler/obj/freebsd-powerpc64/pp-define.o
FBC src/compiler/obj/freebsd-powerpc64/pp-pragma.o
FBC src/compiler/obj/freebsd-powerpc64/pp.o
FBC src/compiler/obj/freebsd-powerpc64/reg.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-array.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-console.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-data.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-error.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-file.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-gfx.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-gosub.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-macro.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-math.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-mem.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-oop.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-print.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-profile.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-string.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-system-thread.o
FBC src/compiler/obj/freebsd-powerpc64/rtl-system.o
FBC src/compiler/obj/freebsd-powerpc64/rtl.o
FBC src/compiler/obj/freebsd-powerpc64/stack.o
FBC src/compiler/obj/freebsd-powerpc64/symb-comp.o
FBC src/compiler/obj/freebsd-powerpc64/symb-const.o
FBC src/compiler/obj/freebsd-powerpc64/symb-data.o
FBC src/compiler/obj/freebsd-powerpc64/symb-define.o
FBC src/compiler/obj/freebsd-powerpc64/symb-enum.o
FBC src/compiler/obj/freebsd-powerpc64/symb-keyword.o
FBC src/compiler/obj/freebsd-powerpc64/symb-label.o
FBC src/compiler/obj/freebsd-powerpc64/symb-mangling.o
FBC src/compiler/obj/freebsd-powerpc64/symb-namespace.o
FBC src/compiler/obj/freebsd-powerpc64/symb-proc.o
FBC src/compiler/obj/freebsd-powerpc64/symb-scope.o
FBC src/compiler/obj/freebsd-powerpc64/symb-struct.o
FBC src/compiler/obj/freebsd-powerpc64/symb-typedef.o
FBC src/compiler/obj/freebsd-powerpc64/symb-var.o
FBC src/compiler/obj/freebsd-powerpc64/symb.o
LINK bin/fbc
error 23: File not found, crt1.o
error 132: Too many errors, exiting
/usr/local/bin/../bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000010203708
/usr/local/bin/../bin/ld: /lib/libc.so.7: undefined reference to `__progname'
/usr/local/bin/../bin/ld: /lib/libc.so.7: undefined reference to `environ'
gmake: *** [makefile:582: bin/fbc] Error 1
marcov
Posts: 3071
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: FB for FreeBSD/powerpc64

Postby marcov » Feb 16, 2021 21:50

error 23: File not found, crt1.o


This is the startup file called CSU. Easiest to get these from target. crt1/crtn/crtbegin/crtend etc.
lenoil98
Posts: 4
Joined: Feb 16, 2021 0:13
Location: USA

Re: FB for FreeBSD/powerpc64

Postby lenoil98 » Feb 16, 2021 22:50

Yes, I know. The file is located in "/usr/lib" along with crtbeginS.o, crtend.o, crti.o, crtsavres.o, crtbegin.o, crtbeginT.o, crtendS.o, crtn.o. Do I need to move them where the compiler can find them?
lenoil98
Posts: 4
Joined: Feb 16, 2021 0:13
Location: USA

Re: FB for FreeBSD/powerpc64

Postby lenoil98 » Feb 17, 2021 1:07

Success!!

I answered my own question and moved the files to the FBC "lib" directory and it's now working. I was able to successfully compile hello.bas in the examples directory and it worked.

Now I'm going to play with it to ensure everything's working. I've been alerted that there may be some big-endian issues.
srvaldez
Posts: 2635
Joined: Sep 25, 2005 21:54

Re: FB for FreeBSD/powerpc64

Postby srvaldez » Feb 17, 2021 13:22

@lenoil98
interesting, please report your progress and or obstacles that you had to overcome
marcov
Posts: 3071
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: FB for FreeBSD/powerpc64

Postby marcov » Feb 17, 2021 15:52

cross toolchains sometimes don't add default directories.
jj2007
Posts: 1925
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: FB for FreeBSD/powerpc64

Postby jj2007 » Feb 17, 2021 16:33

lenoil98 wrote:I've been alerted that there may be some big-endian issues.
You've seen the recent change endianness thread?
lenoil98
Posts: 4
Joined: Feb 16, 2021 0:13
Location: USA

Re: FB for FreeBSD/powerpc64

Postby lenoil98 » Feb 21, 2021 4:41

srvaldez wrote:@lenoil98
interesting, please report your progress and or obstacles that you had to overcome


With the help of (@rversteegen) I’ve made significant progress and now have a working fbc. I’ve successfully built and run the log tests with no failures. The unit tests build, but get errors running the test. Seems FreeBSD does not like how fb declares Boolean true as (-1).

Anyone interested in trying fbc on FreeBSD can find my work at: https://GitHub.com/lenoil98/fbc

Don’t forget to copy the crt* files to the lib/freebasic/freebsd-powerpc64 directory before attempting to compile any of the example code. If you install fbc, you’ll also need to copy these same files to /usr/local/lib/freebasic/freebsd-powerpc64. The ability of fbc to locate needed libraries and files seems to be broken on FreeBSD. I had to manually add the needed libs to fbc-test for it to link successfully.

Return to “Linux”

Who is online

Users browsing this forum: No registered users and 5 guests