Ticket #318: static-undefined.diff

File static-undefined.diff, 3.5 KB (added by KO Myung-Hun, 10 years ago)

patch for undefined symbols problem of -static

  • src/gcc/gcc/config/i386/emx.h

    diff --git a/src/gcc/gcc/config/i386/emx.h b/src/gcc/gcc/config/i386/emx.h
    index bc6c536..58c3653 100755
    a b do { \ 
    443443  "%{Zexe} %{Zstack*} %{Zmap*} %{Zsym} %{Zdll} %{shared:-Zdll} %{static:-static} " \
    444444  "%{!o*:-o %b%{Zdll|shared:.dll}%{!Zdll:%{!shared:%{!Zexe:.exe}}}} "          \
    445445  "%{static:%{Zcrtdll*:%e-static and -Zcrtdll are incompatible}}"              \
    446   "%{Zomf:%{Zaout:%e-Zomf and -Zaout are incompatible}}"                       \
     446  "%{Zomf|static:%{Zaout:%e-Zomf and -Zaout are incompatible}}"                \
    447447  "%{Zdll:%{Zexe:%e-Zdll and -Zexe are incompatible}}"                         \
    448448  "%{shared:%{Zexe:%e-shared and -Zexe are incompatible}}"                     \
    449449  "%{Zsmall-conv:%{Zcrtdll*:%e-Zsmall-conv and -Zcrtdll are incompatible}}"
    do { \ 
    470470#define LIB_SPEC                                                               \
    471471  "-lc_alias "                                                                 \
    472472  "%{!static:-lc_dll}"                                                         \
    473   "%{static:-lc%{p|pg:_p}_s %{!Zdll:%{!shared:-lc_app%{pg:_p}}}} "             \
     473  "%{static:-lc%{p|pg:_p}_s %{!Zdll:%{!shared:-lc_app%{pg:_p}}} -lc_omf386} "  \
    474474  "-los2%{p|pg:_p}"
    475475
    476476/* Override the default crt0 files.
    477477   bird: we might consider kicking gcrt & mcrt stuff now... */
    478478#define STARTFILE_SPEC                                                         \
    479479  "%{Zno-high-mem:}%{Zfork:}%{Zunix:}"                                         \
    480   "%{Zdll|shared:dll0%{Zhigh-mem:hi}%{Zno-fork:nofork}%{Zno-unix:noux}%O%{Zomf:bj}%s}" \
    481   "%{!Zdll:%{!shared:%{pg:gcrt0%O%{Zomf:bj}%s}"                                          \
    482           "%{!pg:%{pn:gcrt0%O%{Zomf:bj}%s}"                                    \
    483                 "%{!pn:%{p:mcrt0%O%{Zomf:bj}%s}"                               \
    484                       "%{!p:crt0%{Zhigh-mem:hi}%{Zno-fork:nofork}%{Zno-unix:noux}%{Zargs-wild:wild}%{Zargs-resp:resp}%O%{Zomf:bj}%s}}}}" \
    485   " %{Zbin-files:binmode%O%{Zomf:bj}%s}"                                       \
    486   " %{Zsmall-conv:smallcnv%O%{Zomf:bj}%s}}"
     480  "%{Zdll|shared:dll0%{Zhigh-mem:hi}%{Zno-fork:nofork}%{Zno-unix:noux}%O%{Zomf|static:bj}%s}" \
     481  "%{!Zdll:%{!shared:%{pg:gcrt0%O%{Zomf|static:bj}%s}"                         \
     482          "%{!pg:%{pn:gcrt0%O%{Zomf|static:bj}%s}"                             \
     483                "%{!pn:%{p:mcrt0%O%{Zomf|static:bj}%s}"                        \
     484                      "%{!p:crt0%{Zhigh-mem:hi}%{Zno-fork:nofork}%{Zno-unix:noux}%{Zargs-wild:wild}%{Zargs-resp:resp}%O%{Zomf|static:bj}%s}}}}" \
     485  " %{Zbin-files:binmode%O%{Zomf|static:bj}%s}"                                \
     486  " %{Zsmall-conv:smallcnv%O%{Zomf|static:bj}%s}}"
    487487
    488488/* Prefer symbols in %L (-lc) over %G (libcAB.dll includes gcc3XY.dll).
    489489   For the GNU linker we need to repeate everything as it doesn't
    490490   restart the library search as the IBM and M$ linkers do. */
    491 #define LINK_GCC_C_SEQUENCE_SPEC        "%L %G %L %{!Zomf:%G %L %G %L %G %L}"
     491#define LINK_GCC_C_SEQUENCE_SPEC        "%L %G %L %{!Zomf:%{!static:%G %L %G %L %G %L}}"
    492492
    493 #define ENDFILE_SPEC                    "%{Zomf:-lend}"
     493#define ENDFILE_SPEC                    "%{Zomf|static:-lend}"
    494494
    495495/* Override the default linker program (collect2).  */
    496 #define LINKER_NAME                     "%{Zomf:emxomf}ld.exe"
     496#define LINKER_NAME                     "%{Zomf|static:emxomf}ld.exe"
    497497
    498498
    499499