Linking fpc files error
Linking fpc files error
I recently converted my os to free pascal. It compiles fine however when i try link the files i get an error 'PE operations in non PE file' or 'kernel.o is an unknown type'. The second one is when i use linux-i386 LD. I link with this command LD -T linker.ld -o kernel.Exe kernel.o console.o
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Currently - Busy with FAT12 driver and VFS
Re: Linking fpc files error
Doing this on windows?
Let's see the linker script.
What's your commandline for fpc?
Let's see the linker script.
What's your commandline for fpc?
http://j-software.dk | JPasKernel - My Object Pascal kernel
Re: Linking fpc files error
Hi,
I wonder if you would benefit from the GCC Cross-Compiler tutorial? I know you are using Pascal, but perhaps you could just cross compile binutils and use ld from there?
Cheers,
Adam
I wonder if you would benefit from the GCC Cross-Compiler tutorial? I know you are using Pascal, but perhaps you could just cross compile binutils and use ld from there?
Cheers,
Adam
Re: Linking fpc files error
When i compile pascal now it says 'ppc complied for a different system' is this because i am not using linux? If i try link using the win32 version of ld i get a whole bunch of undefined reference errors
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Currently - Busy with FAT12 driver and VFS
Re: Linking fpc files error
Could we by any chance see the whole commandline?
http://j-software.dk | JPasKernel - My Object Pascal kernel
Re: Linking fpc files error
I assume you're targetting ELF and you're using ld that comes from MinGW (the one in FPC distribution comes from MinGW). This won't work! Though ld --help shows that it supports ELF, it actually doesn't. You need cross binutils for this (which you already have as i386-linux-ld).PE operations in non PE file
This is because you're compiling the kernel without any -T or -A command line option. The default target for Win32 is of course pe(i)-i386. i386-linux-ld will target elf32-i386, check your linker script for OUTPUT_FORMAT.kernel.o is an unknown type
Re: Linking fpc files error
I compile using -AElf and -TLinux but then FPC gives me the error saying ppc32 was compiled for use on another system 
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Currently - Busy with FAT12 driver and VFS
Re: Linking fpc files error
What's ppc32? Are you sure you have the newest version?
http://j-software.dk | JPasKernel - My Object Pascal kernel
Re: Linking fpc files error
Yes i have the latest version. If u go and look in the FPC directory u will see the exe called ppc32 i have no idea what it does. Or why it runs when i use fpc. The other thing is when i use fpc with -Tlinux and -Aelf i get an error saying it can not find the system file used. I will post a shot of the error screen
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Currently - Busy with FAT12 driver and VFS
Re: Linking fpc files error
Ok i finally fixed the problem. My system.o file was not compiled for linux and thus i could not use it. I recompiled it and made the changes and now it works fine. Still one or two bugs to sort out in the includes but im almost done. Thanks for your help
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Currently - Busy with FAT12 driver and VFS


