Rev 6429 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6429 | Rev 9615 | ||
---|---|---|---|
Line 16... | Line 16... | ||
16 | * You should have received a copy of the GNU Lesser General Public |
16 | * You should have received a copy of the GNU Lesser General Public |
17 | * License along with this library; if not, write to the Free Software |
17 | * License along with this library; if not, write to the Free Software |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | */ |
19 | */ |
Line -... | Line 20... | ||
- | 20 | ||
20 | 21 | #include "libtcc.h" |
|
Line 21... | Line 22... | ||
21 | #include "tcc.h" |
22 | #include "tcc.h" |
22 | 23 | ||
Line 1616... | Line 1617... | ||
1616 | 1617 | ||
1617 | /* add tcc runtime libraries */ |
1618 | /* add tcc runtime libraries */ |
1618 | ST_FUNC void tcc_add_runtime(TCCState *s1) |
1619 | ST_FUNC void tcc_add_runtime(TCCState *s1) |
1619 | { |
1620 | { |
1620 | tcc_add_pragma_libs(s1); |
- | |
1621 | 1621 | tcc_add_pragma_libs(s1); |
|
1622 | /* add libc */ |
1622 | /* add libc */ |
- | 1623 | if (!s1->nostdlib) { |
|
1623 | if (!s1->nostdlib) { |
1624 | #if !defined (TCC_TARGET_MEOS) |
1624 | tcc_add_library(s1, "c"); |
1625 | tcc_add_library(s1, "c"); |
1625 | #ifdef CONFIG_USE_LIBGCC |
1626 | #ifdef CONFIG_USE_LIBGCC |
1626 | if (!s1->static_link) { |
1627 | if (!s1->static_link) { |
1627 | tcc_add_file(s1, TCC_LIBGCC, TCC_FILETYPE_BINARY); |
1628 | tcc_add_file(s1, TCC_LIBGCC, TCC_FILETYPE_BINARY); |
1628 | } |
1629 | } |
1629 | #endif |
- | |
1630 | #if !defined(TCC_TARGET_MEOS) |
1630 | #endif |
- | 1631 | tcc_add_support(s1, "libtcc1.a"); |
|
- | 1632 | #else |
|
- | 1633 | if (tcc_add_library_err(s1, "c") < 0 || |
|
- | 1634 | tcc_add_library_err(s1, "tcc1") < 0) { |
|
- | 1635 | exit(1); |
|
1631 | tcc_add_support(s1, "libtcc1.a"); |
1636 | } |
1632 | #endif |
1637 | #endif |
Line 1633... | Line 1638... | ||
1633 | } |
1638 | } |
1634 | 1639 | ||
1635 | /* tcc_add_bcheck tries to relocate a call to __bound_init in _init so |
1640 | /* tcc_add_bcheck tries to relocate a call to __bound_init in _init so |
1636 | libtcc1.a must be loaded before for __bound_init to be defined and |
1641 | libtcc1.a must be loaded before for __bound_init to be defined and |
1637 | crtn.o must be loaded after to not finalize _init too early. */ |
- | |
- | 1642 | crtn.o must be loaded after to not finalize _init too early. */ |
|
1638 | tcc_add_bcheck(s1); |
1643 | tcc_add_bcheck(s1); |
1639 | 1644 | #if !defined (TCC_TARGET_MEOS) |
|
1640 | if (!s1->nostdlib) { |
1645 | if (!s1->nostdlib) { |
1641 | /* add crt end if not memory output */ |
- | |
1642 | if (s1->output_type != TCC_OUTPUT_MEMORY) |
- | |
1643 | #if defined(TCC_TARGET_MEOS) |
- | |
1644 | ; |
- | |
1645 | // tcc_add_crt(s1, "start.o"); |
1646 | /* add crt end if not memory output */ |
1646 | #else |
- | |
1647 | tcc_add_crt(s1, "crtn.o"); |
1647 | if (s1->output_type != TCC_OUTPUT_MEMORY) |
- | 1648 | tcc_add_crt(s1, "crtn.o"); |
|
1648 | #endif |
1649 | } |
Line 1649... | Line 1650... | ||
1649 | } |
1650 | #endif |
1650 | } |
1651 | } |
1651 | 1652 |