Commit Graph

920 Commits

Author SHA1 Message Date
Jeppe Johansen
47dbec3111 Rebase to trunk revision
git-svn-id: branches/laksen/armiw@29708 -
2015-02-15 16:08:18 +00:00
Jeppe Johansen
55fe3b4e77 Disable internal linker in arm-linux for now.
git-svn-id: branches/laksen/armiw@29707 -
2015-02-15 15:44:10 +00:00
Tomas Hajny
7e15bf6c2d * ensure passing valid stacksize to emxbind
git-svn-id: trunk@29700 -
2015-02-15 01:56:08 +00:00
pierre
bc5df9bc68 Remove complicated code to try to support older GNU linker versions, before 2.21
git-svn-id: trunk@29647 -
2015-02-08 07:28:49 +00:00
Jeppe Johansen
7a826cc481 Fix compilation of i386-embedded target.
git-svn-id: trunk@29610 -
2015-02-03 00:22:51 +00:00
pierre
c5de263637 Set default assembler to elf64 writer for x86_64-solaris target
git-svn-id: trunk@29575 -
2015-01-29 07:40:30 +00:00
Tomas Hajny
608b14ab4e * make sure that the stack size passed to emxbind is valid (override the value passed using $M if necessary)
git-svn-id: trunk@29573 -
2015-01-28 08:00:01 +00:00
florian
b98e13cd93 * ensure success is initialized
git-svn-id: trunk@29549 -
2015-01-25 15:16:11 +00:00
Tomas Hajny
f0132e252c * fixed DLL importing by name
git-svn-id: trunk@29540 -
2015-01-24 00:35:49 +00:00
pierre
ce20dcf7a6 * Add code to try old GNU emulation if new names are not recognized
* Add support for map file
  * Add -lc (for libc library) two times instead of only at the end.

git-svn-id: trunk@29521 -
2015-01-22 16:45:52 +00:00
pierre
aebebe4f04 i386-solaris target: Add flags for pic code uses GOT and library requires pic
git-svn-id: trunk@29520 -
2015-01-22 15:14:35 +00:00
florian
2c7f1c73ac * pass -m elf_i386_sol2 to gld on i386-solaris as well, patch by H.Hartl, resolves #27265
git-svn-id: trunk@29501 -
2015-01-18 11:19:42 +00:00
marco
1b85962ef3 * put default libgcc path under if Dontlinkstdlibpath...
git-svn-id: trunk@29447 -
2015-01-12 10:34:39 +00:00
Jeppe Johansen
7390acc426 Merged from recent trunk.
git-svn-id: branches/laksen/armiw@29369 -
2015-01-01 23:54:40 +00:00
sergei
da8346079f * mips-linux: Enabled tf_safecall_exceptions (it just works, no reason to keep disabled) and also tf_pic_uses_got (so that checks elsewhere in compiler set pi_needs_got flag; actual functionality is not changed because currently MIPS just forces pi_needs_got unconditionally).
git-svn-id: trunk@29360 -
2014-12-29 23:26:40 +00:00
florian
0a19825e25 * elf_x86_64 -> elf_x86_64_sol2, should resolve #27199
git-svn-id: trunk@29358 -
2014-12-29 17:57:45 +00:00
Jeppe Johansen
3ad03491ed Add Neg as a pseudo instruction, and fix RRX pseudo code expansion.
Split some of the thumb code emission rules to make it easier to specify short-cut notations.

git-svn-id: branches/laksen/armiw@29345 -
2014-12-27 17:44:30 +00:00
Jeppe Johansen
9e5979e8be Implemented UAL syntax support in the ARM assembler reader. Can be toggled with a field for now, but not implemented yet. Still using pre-UAL syntax for now.
Switched codegeneration of VFPv2 and VFPv3 to use UAL mnemonics and syntax.
Updated VFP code in RTL to use UAL syntax too.
Added preliminary ELF support for ARM.
Added support for linking of WinCE COFF files. Should work for with a standard ARMv4-I target.

git-svn-id: branches/laksen/armiw@29247 -
2014-12-10 20:44:34 +00:00
marco
2578514853 * first dragonfly patch (existing most). Mantis #27091
git-svn-id: trunk@29213 -
2014-12-07 20:27:02 +00:00
pierre
016666c70f Use pic code by default for x86_64-openbsd
git-svn-id: trunk@29138 -
2014-11-23 22:04:30 +00:00
pierre
82b99d09bd Add tf_smartlink_sections for i386-bsd target
git-svn-id: trunk@29137 -
2014-11-23 22:01:25 +00:00
pierre
2202d60cdc Allow use of native ld or GNU gld for AIX
git-svn-id: trunk@29047 -
2014-11-09 22:22:29 +00:00
Tomas Hajny
0a74c30351 * run EMX linker quietly
git-svn-id: trunk@29000 -
2014-11-06 12:14:00 +00:00
Tomas Hajny
a593cc2def * fix missing space when passing additional parameters to the EMX linker
git-svn-id: trunk@28999 -
2014-11-06 11:42:39 +00:00
Jonas Maebe
7398f8d507 * fixed defines separator
git-svn-id: trunk@28877 -
2014-10-19 10:25:07 +00:00
marco
ff2186ce00 * OpenBSD gets no pie. (add -nopie)
git-svn-id: trunk@28736 -
2014-10-04 11:12:14 +00:00
Károly Balogh
6122db7d40 * fix warnings when compiling the compiler with DFA optimizer enabled on PowerPC
git-svn-id: trunk@28501 -
2014-08-20 14:31:36 +00:00
Károly Balogh
392da9e43f * fix warnings when compiling the compiler with DFA optimizer enabled on m68k
git-svn-id: trunk@28499 -
2014-08-20 13:49:47 +00:00
Károly Balogh
09608a1c28 * fix warnings when compiling the compiler with DFA optimizer enabled on ARM
git-svn-id: trunk@28498 -
2014-08-20 13:16:58 +00:00
Károly Balogh
07ad2a04ac * fix warnings when compiling the compiler with DFA optimizer enabled on i386
git-svn-id: trunk@28497 -
2014-08-20 12:28:44 +00:00
Jonas Maebe
b18ba8e85b * syncrhonised with trunk up till r28471
git-svn-id: branches/hlcgllvm@28495 -
2014-08-19 20:23:11 +00:00
Károly Balogh
03a0f7b409 AROS: improved version of the previous commit, pass the stripping option to the linker instead, seems to work.
git-svn-id: trunk@28466 -
2014-08-19 11:30:02 +00:00
Károly Balogh
883e71f18e AROS: stripping of executables on i386 works now
git-svn-id: trunk@28465 -
2014-08-19 11:03:31 +00:00
Károly Balogh
8627cc3ddb AROS: added remark about collect-aros issue, fixed ld name for x86_64 target
git-svn-id: trunk@28444 -
2014-08-18 16:17:06 +00:00
Károly Balogh
2f086129e1 AROS: use collect-aros to link. also support binutils prefixes.
git-svn-id: trunk@28443 -
2014-08-18 14:55:02 +00:00
Károly Balogh
1410838aa7 AROS: and also add the system info/target units which were forgotten in the previous commit
git-svn-id: trunk@28433 -
2014-08-17 18:36:57 +00:00
Jonas Maebe
5c75b6dd6b * synchronised with trunk up till r28402
git-svn-id: branches/hlcgllvm@28403 -
2014-08-13 16:04:30 +00:00
sergei
b9763d270a + Enabled section smartlinking for m68k-linux.
git-svn-id: trunk@28302 -
2014-08-02 23:00:36 +00:00
Legolas
a52e51d0b7 * Updated libndsfpc and nds linkerscript to Ver. 1.5.8
git-svn-id: trunk@28299 -
2014-08-02 15:23:51 +00:00
sergei
15ff2c1236 * m68k: Fixed name of ELF interpreter, and updated cprt0.as to somewhat working state. Now a "hello world" program using libc can be linked and launched, but anything more complex needs another round of fixing the parameter passing code, in order to get the stack properly balanced.
git-svn-id: trunk@28181 -
2014-07-07 20:08:50 +00:00
Jonas Maebe
7949bebb8d * synchronised with r28168 of trunk
git-svn-id: branches/hlcgllvm@28169 -
2014-07-05 21:30:28 +00:00
Jonas Maebe
a24c81a5f8 * added llvmdatalayout for mipsel-android
git-svn-id: branches/hlcgllvm@28104 -
2014-07-01 16:29:54 +00:00
nickysn
9f31fcc2ca + added support for HeapMax in the far data i8086 memory models as well
git-svn-id: trunk@28051 -
2014-06-24 22:54:54 +00:00
Jeppe Johansen
0dc39b5d63 Applied patch from Michael Ring that adds some startup code for some new stm32f0 and stm32f1 controllers, and fixes naming on some LPC ARMv6m controllers.
git-svn-id: trunk@28009 -
2014-06-20 06:49:04 +00:00
nickysn
7cfd7a66cd + create a special 'heap' segment with reserved space equal to heapsize (i.e.
the value set by -Ch or the second parameter to the $M directive). This is
  equivalent to the heapmin value in Turbo Pascal 7 and ensures that the program
  has at least this amount of heap space available (otherwise DOS will show a
  'not enough memory' error and will refuse to load the program).

git-svn-id: trunk@28002 -
2014-06-19 14:14:01 +00:00
nickysn
49f93b4464 * use the 'order' wlink directive to specify the segment order, instead of using
'option dosseg'. This allows us more flexibility in setting up the segment
  order the way we like.

git-svn-id: trunk@27958 -
2014-06-14 18:04:58 +00:00
nickysn
a52d8abe38 * changed the default stack size in the i8086 far data memory models to 16 KB
git-svn-id: trunk@27841 -
2014-06-01 14:38:54 +00:00
Jonas Maebe
bacd303208 * synchronized with trunk up to r27758
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
pierre
179390d63d Use script gnu ar for go32v2 target
git-svn-id: trunk@27515 -
2014-04-10 16:20:14 +00:00
pierre
62b3375033 Use slash instead of backslash inside linker script to allow use of cross-linker
git-svn-id: trunk@27509 -
2014-04-10 13:24:42 +00:00
nickysn
510fa9596f * add 'option quiet' to wlink to suppress its info messages
git-svn-id: trunk@27271 -
2014-03-24 18:13:29 +00:00
florian
b2b26f84cf * partially merged the mips-embedded branch of Michael Ring:
- startup code/controller units are not merged yet
  - assembler call does not pass the needed CPU type yet

git-svn-id: trunk@27188 -
2014-03-19 21:25:38 +00:00
florian
2c5a0ffc89 * make windres the default resource compiler on x86_64-win64
git-svn-id: trunk@27041 -
2014-03-09 10:52:10 +00:00
pierre
7b359d06c4 Use GNU ar also for x86_64 solaris
git-svn-id: trunk@27022 -
2014-03-07 12:39:48 +00:00
Jonas Maebe
e9268a0a14 * synchronised with trunk up till r26975
git-svn-id: branches/hlcgllvm@26976 -
2014-03-06 21:36:58 +00:00
Jeppe Johansen
e33550b67d Added support for X,Y,and Z register aliases plus low/high forms, and post-incrementation in AVR assembler reader.
Cleaned up parameter and funcretloc information generation in AVR paramanger, and made it closer to GCC's calling convention.
Fixed a number of codegenerator bugs generating invalid or broken instructions: CP operands were swapped, a number of instructions had immediate operands, and stack frame epilogue wasn't complete.
Added a bunch of peephole optimizations that clears the generated code up a lot.

git-svn-id: trunk@26925 -
2014-03-02 15:37:24 +00:00
Károly Balogh
0591caf022 have an explicit define for OS4, so we can easily identify it in shared sources among Amiga-like systems, independent from the CPU define
git-svn-id: trunk@26859 -
2014-02-23 23:49:40 +00:00
yury
e0c8a4701e * Fixed compilation for mips-linux.
git-svn-id: trunk@26732 -
2014-02-08 19:08:21 +00:00
yury
bb269e53ac * mipsel-android: Don't export local symbols from executable.
git-svn-id: trunk@26690 -
2014-02-06 19:11:08 +00:00
yury
56b3287e29 + Added compiler support for mipsel-android target.
git-svn-id: trunk@26686 -
2014-02-06 17:02:43 +00:00
pierre
9fc9f4bdba Use new as_i8086_nasmobj as external assembler for msdos target
git-svn-id: trunk@26549 -
2014-01-21 00:27:42 +00:00
pierre
2a6e592fba Handle link map for msdos wlink
git-svn-id: trunk@26461 -
2014-01-14 21:40:02 +00:00
Jonas Maebe
ca446b4b2a - removed registration of x86_6432 target because it's not supported in any
way by the compiler (and furthermore it would have to be registerd in an
    the x86_64 compiler binary, not an i386 one) (mantis #25525)

git-svn-id: trunk@26460 -
2014-01-14 20:37:18 +00:00
pierre
291124489f Use scripted version of wlib for go32v2 msdos smart library creation
git-svn-id: trunk@26444 -
2014-01-12 23:21:16 +00:00
Jeppe Johansen
d24cbbf9f5 Changed debug information to dwarf for ARM_embedded, and set local minimum alignment to 4.
Fixed a bug where ARMv7M targets would not use the DIV instructions.
Moved many size-optimizing Thumb2 peephole optimizations to PostPeepHoleOptsCpu. Previously those optimizations could make it impossible to reuse the shared arm peephole optimizations.
Reenabled a fixed MLA/MLS peephole optimization.
Refactored some FindRegDealloc+regLoadedWithNewValue into RegEndOfLife calls.
Fixed some broken UXTB/UXTH optimizations. Previously they would also match UXT* instructions with ROR shifter ops.

git-svn-id: trunk@26198 -
2013-12-08 16:50:15 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
florian
c357212b45 + search crt* files also in /usr/lib/x86_64-linux-gnu, multiarch supporting distros require this
git-svn-id: trunk@26158 -
2013-12-01 15:39:05 +00:00
Károly Balogh
34702dbfc5 fixed staticlibprefix for Amiga and MorphOS
git-svn-id: trunk@26127 -
2013-11-24 04:19:59 +00:00
Károly Balogh
da3603e663 introduce HASAMIGA define to easily identify various Amiga flavors (similarly to HASUNIX)
git-svn-id: trunk@26123 -
2013-11-24 01:19:52 +00:00
Jonas Maebe
9573160c1a + llvmdatalayout field for tsysteminfo that contains the encoded data layout
as used by llvm for most targets (taken from clang, adapted in some cases
    where we use a custom stack alignment)

git-svn-id: branches/hlcgllvm@26032 -
2013-11-11 11:14:55 +00:00
nickysn
12b1e0cbfd + tell wlink to add dwarf debug info to the executable when -gw2/3/4 is used
git-svn-id: trunk@25874 -
2013-10-27 20:30:00 +00:00
paul
d16606b04c compiler: revert r25852 since 10.9 is already handled
git-svn-id: trunk@25864 -
2013-10-27 14:17:29 +00:00
florian
de2e4632c5 * if a build-id is generated, put it into flash
git-svn-id: trunk@25853 -
2013-10-26 14:19:14 +00:00
paul
43b9308929 compiler: also skip crt1.o for osx 10.9
git-svn-id: trunk@25852 -
2013-10-26 13:36:40 +00:00
Jonas Maebe
40eafc3d82 * don't try to post-process embedded executables when linking is
disabled

git-svn-id: trunk@25851 -
2013-10-26 10:01:05 +00:00
Jonas Maebe
a28917086b * updated *crt1* linking logic for OS X 10.8+:
o don't link by default
   o when generating profiling info, link gcrt1.o and specify "-no_new_main"
     linker parameter
  * don't use version-specific crt1.o files when targetting the
    iPhoneSimulator platform
  * don't link a crt1.o file when targetting iOS 6 or later
  (all info from
   http://llvm.org/svn/llvm-project/cfe/trunk/lib/Driver/Tools.cpp )

git-svn-id: trunk@25789 -
2013-10-14 21:38:38 +00:00
florian
304d7ef7a1 * restores atari support/rtl partially
git-svn-id: trunk@25699 -
2013-10-06 19:36:59 +00:00
nickysn
96a4f8e43b * the staticlibext for i8086-msdos changed from .lib to .a; rationale:
1) less special cases needed in fpmkunit for i8086-msdos
  2) consistency with the naming scheme on the go32v2 target
  3) we didn't follow the DOS naming scheme completely anyway, e.g. we used .o
     for object files, instead of .obj

git-svn-id: trunk@25641 -
2013-10-05 10:01:59 +00:00
marco
2a9916baba * fix mantis #25129 for non OS X BSD systems. Patch by A. Cardenas Marquez
- crtbegin and crtend suffix handling
     - crti before crtbegin

git-svn-id: trunk@25620 -
2013-10-02 09:05:32 +00:00
nickysn
a48b44cfe5 + added a new tsystemflag tf_cld, which indicates that ts_cld should be enabled
by default on this target
+ tf_cld enabled for i8086-msdos (for Turbo Pascal compatibility)

git-svn-id: trunk@25595 -
2013-09-28 14:57:12 +00:00
Jonas Maebe
2c664ac6ae * fix compatibility with new Package Management system under Haiku
(patch by Olivier Coursiere, mantis #25051)

git-svn-id: trunk@25573 -
2013-09-25 20:57:41 +00:00
nickysn
52a5ffc386 * use apptype to indicate that the target is a DOS .COM file, instead of introducing a new field in tsettings (as suggested by Sven)
git-svn-id: trunk@25544 -
2013-09-24 12:13:47 +00:00
nickysn
567cdf875b + added new i8086 compiler options -Wtexe and -Wtcom for specifying the MS-DOS
binary format (.exe or .com)
* the default format for i8086 tiny model binaries changed to .exe

git-svn-id: trunk@25528 -
2013-09-21 16:44:14 +00:00
Jonas Maebe
1af312c129 * don't overwrite result of librarysearchpath.FindFile() in
GetDarwinPrtobjName() if it found something

git-svn-id: trunk@25330 -
2013-08-22 21:37:06 +00:00
Jonas Maebe
528f5d1096 * initialise result of GetDarwinPrtobjName() in case GetDarwinCrt1ObjName()
returns an empty string

git-svn-id: trunk@25328 -
2013-08-22 19:55:57 +00:00
Jonas Maebe
4ec9ec2009 + PIC support for Darwin/ARM:
o does not use GOT
   o enabled by default like for other Darwin platforms
  - removed Darwin/ARM call stub support: no longer needed with current
    Xcode versions (at least Xcode 4.2+), and we didn't support PIC
    in them yet

git-svn-id: trunk@25325 -
2013-08-22 08:14:24 +00:00
florian
6606955b88 + basic support for pic on arm-linux
git-svn-id: trunk@25297 -
2013-08-19 21:35:37 +00:00
sergei
38058505ba * Changed linking infrastructure to look like assembler one:
* Changed direct references to linker classes in TSystemInfo records to enumerated ids.
  * RegisterExtennalLinker and RegisterInternalLinker procedures replaced by single RegisterLinker procedure and moved to link.pas.
  - TAbstractLinker is no longer necessary, removed.

This change allows to register linker once per id, rather than once per target, and also allows TSystemInfo records to be read-only.

git-svn-id: trunk@25279 -
2013-08-18 12:01:21 +00:00
sergei
eec8129738 * TInternalLinker.Load_ReadStaticLibrary: exit if error has occurred while opening a static library or dynamic object, continuing can cause other errors/crashes in this case.
* t_linux.pas: use sysrootpath when specifying dynamic interpreter (for cross-linking).

git-svn-id: trunk@25277 -
2013-08-18 09:14:16 +00:00
sergei
1f8a67f552 + Property TObjSymbol.ObjData, allows to access owning TObjData for external/common symbols, i.e. ones with ObjSection=nil.
* For common symbols, report objdata of the original ObjSymbol, not of the resolving one, so the map file shows where it comes from.
+ TElfExeOutput.OrderOrphanSections method, handles object sections not mentioned in script similar to ld.
- t_linux.pas: removed sections that are not part of ld scripts, they are now handled by OrderOrphanSections.

git-svn-id: trunk@25184 -
2013-07-30 09:23:48 +00:00
sergei
dddc78514d * Internal ELF linker: for MIPS targets, place .got section after .data. This corresponds to behavior of ld, and reduces amount of processing when adding GOT slots for local symbols (which requires re-doing layout for all sections that come after .got)
git-svn-id: trunk@25154 -
2013-07-21 13:10:57 +00:00
pierre
277ae481b8 Add passing of -k option to linker for msdos and go32v2 targets
git-svn-id: trunk@24981 -
2013-06-26 22:27:16 +00:00
nickysn
f5a9442910 + added the appropriate startup code names for each memory model
git-svn-id: trunk@24832 -
2013-06-09 12:44:03 +00:00
nickysn
e28852d07d * prt0 startup code file for small model renamed to prt0s
git-svn-id: trunk@24809 -
2013-06-05 16:41:39 +00:00
nickysn
b409d600ee + implemented the tiny memory model for i8086-msdos; we now produce working dos .com files as well
git-svn-id: trunk@24793 -
2013-06-02 23:02:10 +00:00
Károly Balogh
af1f84892c try to do VLink support semi-properly, so cross compilation is possible
git-svn-id: trunk@24664 -
2013-05-31 13:04:44 +00:00
Jonas Maebe
b16677a75b * only pass --gc-sections to the linker if smart linking is enabled
(mantis #24396)

git-svn-id: trunk@24465 -
2013-05-07 20:28:54 +00:00
marco
09e742f243 * add a -dfpc define to the resource compiler commandlines, which allows to make FPC specific exceptions in resource scripts. Mantis #24044
git-svn-id: trunk@24438 -
2013-05-04 21:25:36 +00:00
svenbarth
930b76e8fb Fix compilation of WinCE. Change the fixed UNICODE define of WinCE to FPC_OS_UNICODE, so that it won't be undefined when changing the mode/string type and that the usage of a UNICODE API is independant of the mode.
Also adjusted all Windows (Win32/64/CE) units to define a "UNICODE" if "FPC_OS_UNICODE" is defined (except the Jedi units).
Also the common RTL units that checked for UNICODE now check for FPC_OS_UNICODE.

git-svn-id: trunk@24420 -
2013-05-04 11:06:32 +00:00
florian
5e0585c0d0 + introduce tf_no_objectfiles_when_smartlinking so object file generation on i8086-msdos can be turned off
* object file generation on i8086-msdos can be turned off if smartlinking is enabled

git-svn-id: trunk@24396 -
2013-04-30 19:11:55 +00:00