OSDN Git Service

Another CRT_INLINE function implementation rationalization.
[mingw/mingw-org-wsl.git] / mingwrt / Makefile.in
index 9555cbc..79c829e 100644 (file)
@@ -364,12 +364,12 @@ libmingw32.a libmingwex.a libm.a libmingwthrd.a libgmon.a:
 #
 vpath %.c ${mingwrt_srcdir}/mingwex
 vpath %.c ${mingwrt_srcdir}/mingwex/complex
-libmingwex.a: $(addsuffix .$(OBJEXT), cabs carg catan ccoshf clog creal csqrt \
-  cabsf cargf catanf ccoshl clogf crealf csqrtf cabsl cargl catanh ccosl clogl \
-  creall csqrtl cacos casin catanhf cexp cpow csin ctan cacosf casinf catanhl \
-  cexpf cpowf csinf ctanf cacosh casinh catanl cexpl cpowl csinh ctanh cacoshf \
-  casinhf ccos cimag cproj csinhf ctanhf cacoshl casinhl ccosf cimagf cprojf \
-  csinhl ctanhl cacosl casinl ccosh cimagl cprojl csinl ctanl)
+libmingwex.a: $(addsuffix .$(OBJEXT), cabs cabsf cabsl cacos cacosf \
+  cacosh cacoshf cacoshl cacosl casin casinf casinh casinhf casinhl casinl \
+  catan catanf catanh catanhf catanhl catanl ccos ccosf ccosh ccoshf ccoshl \
+  ccosl cexp cexpf cexpl clog clogf clogl cpow cpowf cpowl cproj cprojf \
+  cprojl csin csinf csinh csinhf csinhl csinl csqrt csqrtf csqrtl \
+  ctan ctanf ctanh ctanhf ctanhl ctanl)
 
 libmingwex.a: $(addsuffix .$(OBJEXT), isblank iswblank)
 
@@ -392,7 +392,7 @@ libmingwex.a: $(addsuffix .$(OBJEXT), g__fmt gethex strtopx g_dfmt gdtoa \
 # "inttypes" conversion routines, provided in libmingwex.a
 #
 libmingwex.a: $(addsuffix .$(OBJEXT), \
-  imaxabs imaxdiv strtoimax strtoumax wcstoimax wcstoumax)
+  imaxdiv strtoimax strtoumax wcstoimax wcstoumax)
 
 # Additional math functions, augmenting Microsoft's paltry
 # selection, also delivered in libmingwex.a, (FIXME: and yet
@@ -420,9 +420,9 @@ libmingwex.a: $(addsuffix .$(OBJEXT), cosf cosl acosf acosl sinf sinl asinf \
 # compatibility than their Microsoft equivalents.
 #
 vpath %.c ${mingwrt_srcdir}/mingwex/stdio
-libmingwex.a: $(addsuffix .$(OBJEXT), btowc fopen64 fprintf fseeko64 ftello64 \
-  lseek64 pformat printf snprintf snwprintf sprintf vfprintf vfscanf vfwscanf \
-  vprintf vscanf vsnprintf vsnwprintf vsprintf vsscanf vswscanf vwscanf)
+libmingwex.a: $(addsuffix .$(OBJEXT), btowc fprintf fseeko64 lseek64 \
+  pformat printf snprintf snwprintf sprintf vfprintf vfscanf vfwscanf vprintf \
+  vscanf vsnprintf vsnwprintf vsprintf vsscanf vswscanf vwscanf)
 
 # pformat.$(OBJEXT) needs an explicit build rule, since we need to
 # specify an additional header file path.
@@ -444,12 +444,10 @@ $(addsuffix fmt.$(OBJEXT),varo crto geto seto crtn getn setn): %.$(OBJEXT): ofmt
 #libmingwex.a: $(addsuffix .$(OBJEXT), glob membarrier)
 libmingwex.a: $(addsuffix .$(OBJEXT), mingw-aligned-malloc mingw-fseek glob)
 libmingwex.a: $(addsuffix .$(OBJEXT), getopt basename dirname ftruncate usleep)
+libmingwex.a: $(addsuffix .$(OBJEXT), mkstemp mkdtemp cryptnam)
 
 libmingwex.a: $(addsuffix .$(OBJEXT), tdelete tfind tsearch twalk)
 
-libmingwex.a: $(addsuffix .$(OBJEXT), _Exit atoll lltoa lltow \
-  ulltoa ulltow wtoll)
-
 libmingwex.a: gettimeofday.$(OBJEXT)
 libmingwex.a: $(addsuffix .$(OBJEXT), dirent wdirent dlfcn)
 
@@ -517,6 +515,8 @@ jmpstub_awk_script = test -z "$1" || awk '\
     FUNCTION = gensub( ".*[ ,(:]FUNCTION *= *"symbol".*", "\\1", 1 ); \
     OBJNAME = gensub( "_*(.*)_*", "\\1", 1, FUNCTION )".jmpstub.$$(OBJEXT)"; \
     OBJNAME_CFLAGS = "-D FUNCTION="FUNCTION; \
+    if( match( $$0, ".*[ ,(:]REMAPPED *= *"symbol, alias ) ) \
+      OBJNAME_CFLAGS = OBJNAME_CFLAGS" -D REMAPPED="alias[1]; \
     printf fmt, LIB, OBJNAME, OBJNAME, OBJNAME_CFLAGS; \
   } \
   END { \
@@ -550,8 +550,10 @@ libimpl_awk_script = test -z "$1" || awk '\
 # which identifies the originating file as a system header).
 #
 libimpl_sed_script = sed \
-  -e '/__CRT_ALIAS  *__LIBIMPL.*FUNCTION *= *$1[ ,)].*)/d' \
-  -e '/pragma .* system_header/d'
+  -e '/pragma .* system_header/d' \
+  -e '/__CRT_INLINE  *__LIBIMPL.*FUNCTION *= *$1[ ,)].*)/d' \
+  -e 's/__LIBIMPL.*ALIAS *= *$1[ ,)].*)/__attribute__((__alias__("$1")))/' \
+  -e '/__CRT_ALIAS  *__LIBIMPL.*FUNCTION *= *$1[ ,)].*)/d'
 
 LIBIMPL_CFLAGS = $(CFLAGS) $(INCLUDES) -fno-align-functions
 
@@ -564,9 +566,15 @@ LIBIMPL_CFLAGS = $(CFLAGS) $(INCLUDES) -fno-align-functions
        > $@
 
 # ...and ultimately discarded, after the requisite object file
-# has been compiled.
+# has been compiled; (note that this creates a vulnerability due
+# to possible loss of the object file, while the tracking file is
+# still in place; to circumvent this, we must be able to force a
+# remake of the tracking file, so also regenerating the .c file,
+# before it is compiled).
 #
+libimpl_remake = { $(RM) $1; $(MAKE) --no-print-directory $1; }
 %.libimpl.$(OBJEXT): %.libimpl
+       test -f $<.c || $(call libimpl_remake,$<)
        $(CC) -c $(CPPFLAGS) $(LIBIMPL_CFLAGS) -o $@ $<.c
        $(RM) $<.c