Changeset 2807


Ignore:
Timestamp:
Sep 2, 2006, 8:08:34 AM (19 years ago)
Author:
bird
Message:

some init code.

Location:
trunk/libc
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libc/Makefile.kmk

    r2806 r2807  
    266266startupobjs_TEMPLATE = usr.lib
    267267startupobjs_SOURCES :=
     268ifeq ($(BUILD_TARGET),os2)
    268269define def_startup
    269270$(PATH_TARGET)/crt0$(i).o: src/libc/startup/os2/x86/crt0.s | $(call DIRDEP,$(PATH_TARGET))
     
    345346resp \
    346347,$(eval $(def_startup)))
     348endif # os2
     349
     350ifeq ($(BUILD_TARGET),nt)
     351startupobjs_SOURCES += $(PATH_TARGET)/crt0.o
     352$(PATH_TARGET)/crt0.o: src/libc/startup/nt/x86/crt0.s
     353        $(RM) -f $@
     354        gcc -c -Iinclude -x assembler-with-cpp \
     355                -o $@ \
     356                $<
     357endif
    347358
    348359# binmode
  • trunk/libc/include/emx/startup.h

    r2295 r2807  
    2020 * @{
    2121 */
     22#ifdef __OS2__
    2223/** Array of CRT init functions. */
    2324extern int __crtinit1__;
     
    3233/** Array of destructors. */
    3334extern int __DTOR_LIST__;
     35
     36#elif defined(__NT__)
     37/** Array of CRT init functions. */
     38extern int __crtinit1__;
     39/** Array of CRT exit functions. */
     40extern int __crtexit1__;
     41#endif
    3442/** @} */
    3543
     
    4351#define _ARG_NONZERO  0x80          /* Always set, to avoid end of string   */
    4452
    45 /* Arrange that FUN will be called by _CRT_init(). */
     53/** @def _CRT_INIT1
     54 * Arrange that FUN will be called by _CRT_init(). */
     55/** @def _CRT_TERM1
     56 * Arrange that FUN will be called by _CRT_term(). */
     57#ifdef __OS2__
     58# define _CRT_INIT1(fun) __asm__ (".stabs \"___crtinit1__\", 23, 0, 0, _" #fun);
     59# define _CRT_EXIT1(fun) __asm__ (".stabs \"___crtexit1__\", 23, 0, 0, _" #fun);
     60#elif defined(__NT__)
     61# define _CRT_INIT1(fun) void *__crtinit1__##fun##__  __attribute__((__section__("crtinit1"))) = (void *)fun;
     62# define _CRT_EXIT1(fun) void *__crtexit1__##fun##__  __attribute__((__section__("crtexit1"))) = (void *)fun;
     63#else
     64# error "port me"
     65#endif
    4666
    47 #define _CRT_INIT1(fun) __asm__ (".stabs \"___crtinit1__\", 23, 0, 0, _" #fun);
    4867
    49 /* Arrange that FUN will be called by _CRT_term(). */
    50 
    51 #define _CRT_EXIT1(fun) __asm__ (".stabs \"___crtexit1__\", 23, 0, 0, _" #fun);
    5268
    5369extern char ** _org_environ;
Note: See TracChangeset for help on using the changeset viewer.