Re: [Tack-devel] Assembler and linker
Moved to https://github.com/davidgiven/ack
Brought to you by:
dtrg
From: Sorav B. <sb...@ii...> - 2022-10-28 17:51:06
|
Thanks a lot George for this detailed information --- this is very helpful. Yes I was able to link multiple object files using the instructions in your note. One more question: I see that the ACK compiler supports optimization levels O0-O6. Which of these levels do what transformations? Does ACK support inter-procedural optimizations? Any documentation you would like to point towards for this type of information? Sorav On Thu, Oct 27, 2022 at 11:41 PM George Koehler <ke...@gm...> wrote: > On Thu, 27 Oct 2022 18:21:09 +0530 > Sorav Bansal via Tack-devel <tac...@li...> wrote: > > > I understand that one can use the "-c" and "-c.s" options to generate the > > object and assembly files respectively. Also, as far as I can tell, the > > formats of these object and assembly files are custom formats that are > not > > parseable by any third-party tool. So I assume that the repository > > provides tools to link multiple object files and to assemble a .s file? > > > > Which tool can I use to link multiple .o files generated by "ack -c ..."? > > > > Which tool can I use to assemble a .s file generated by "ack -c.s ..."? > > Run "ack" again to link or assemble those files. You might need > "ack -.c" or "ack -.m2" to link the C or Modula-2 library. > > # Assemble prog2.s and link it with the C library. > ack -mosxppc -c.s prog2.c > ack -mosxppc -.c -o prog2 prog2.s > > # Link part1.o and part2.o with the C library. > ack -mosxppc -c part1.c > ack -mosxppc -c part2.c > ack -mosxppc -.c -o prog3 part1.o part2.o > > If you run "ack -v -v", you can see the commands for the assembler > and the linker: > > $ ack -v -v -mosxppc -.c -o prog2 prog2.s > /home/kernigh/kernigh/park/ack-build/staging/lib/ack/osxppc/as - -o > prog2.o prog2.s > /home/kernigh/kernigh/park/ack-build/staging/lib/ack/em_led -a0:4 -a1:4 > -a2:4096 -a3:4 -b0:0x129c > /home/kernigh/kernigh/park/ack-build/staging/share/ack/osxppc/boot.o > /home/kernigh/kernigh/park/ack-build/staging/share/ack/osxppc/c-ansi.o -o > /tmp/Ack_bdcba.out prog2.o > /home/kernigh/kernigh/park/ack-build/staging/share/ack/osxppc/libc.a > /home/kernigh/kernigh/park/ack-build/staging/share/ack/osxppc/libem.a > /home/kernigh/kernigh/park/ack-build/staging/share/ack/osxppc/libsys.a > /home/kernigh/kernigh/park/ack-build/staging/share/ack/osxppc/libend.a > /home/kernigh/kernigh/park/ack-build/staging/lib/ack/cvmach -m18 > /tmp/Ack_bdcba.out prog2 > > Most targets link objects with em_led, then run a 2nd tool like cvmach > to convert the executable from ack.out format. ack passes some magic > numbers "-b0:0x129c" and libraries "libsys.a" to em_led. > > --George > CAUTION: This email originated from outside of IIT Delhi. Do not click > links or open attachments unless you recognize the sender and know the > content is safe. > > CAUTION: This email originated from outside of IIT Delhi. Do not click > links or open attachments unless you recognize the sender and know the > content is safe. > |