mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-01-26 13:38:15 +03:00
docker: Build MinGW with -mcmodel=small.
(cherry picked from commit c90d4c34d8050ab3b314d5a6243eb36e0c7e9a5c)
This commit is contained in:
parent
e1d797fd97
commit
470f3084eb
@ -61,19 +61,23 @@ DOCKER = docker
|
|||||||
|
|
||||||
%-i686.Dockerfile.in: %.Dockerfile.in
|
%-i686.Dockerfile.in: %.Dockerfile.in
|
||||||
sed -re 's!@ARCH@!i686!g' \
|
sed -re 's!@ARCH@!i686!g' \
|
||||||
|
-re 's!@ARCH_FLAGS@!$(ARCH_FLAGS)!g' \
|
||||||
$< >$@
|
$< >$@
|
||||||
|
|
||||||
%-x86_64.Dockerfile.in: %.Dockerfile.in
|
%-x86_64.Dockerfile.in: %.Dockerfile.in
|
||||||
sed -re 's!@ARCH@!x86_64!g' \
|
sed -re 's!@ARCH@!x86_64!g' \
|
||||||
|
-re 's!@ARCH_FLAGS@!$(ARCH_FLAGS)!g' \
|
||||||
$< >$@
|
$< >$@
|
||||||
|
|
||||||
%-linux-gnu.Dockerfile.in: %.Dockerfile.in
|
%-linux-gnu.Dockerfile.in: %.Dockerfile.in
|
||||||
sed -re 's!@TARGET@!linux-gnu!g' \
|
sed -re 's!@TARGET@!linux-gnu!g' \
|
||||||
|
-re 's!@ARCH_FLAGS@!$(ARCH_FLAGS)!g' \
|
||||||
-re 's!@TARGET_FLAGS@!$(TARGET_FLAGS)!g' \
|
-re 's!@TARGET_FLAGS@!$(TARGET_FLAGS)!g' \
|
||||||
$< >$@
|
$< >$@
|
||||||
|
|
||||||
%-w64-mingw32.Dockerfile.in: %.Dockerfile.in
|
%-w64-mingw32.Dockerfile.in: %.Dockerfile.in
|
||||||
sed -re 's!@TARGET@!w64-mingw32!g' \
|
sed -re 's!@TARGET@!w64-mingw32!g' \
|
||||||
|
-re 's!@ARCH_FLAGS@!$(ARCH_FLAGS)!g' \
|
||||||
-re 's!@TARGET_FLAGS@!$(TARGET_FLAGS)!g' \
|
-re 's!@TARGET_FLAGS@!$(TARGET_FLAGS)!g' \
|
||||||
$< >$@
|
$< >$@
|
||||||
|
|
||||||
@ -118,9 +122,15 @@ $(eval $(call create-binutils-rules,i686,linux-gnu))
|
|||||||
$(eval $(call create-binutils-rules,x86_64,w64-mingw32))
|
$(eval $(call create-binutils-rules,x86_64,w64-mingw32))
|
||||||
$(eval $(call create-binutils-rules,x86_64,linux-gnu))
|
$(eval $(call create-binutils-rules,x86_64,linux-gnu))
|
||||||
|
|
||||||
|
MINGW_ARCH_FLAGS_crt-x86_64 = --disable-lib32 CFLAGS="-mcmodel=small"
|
||||||
|
MINGW_ARCH_FLAGS_crt-i686 = --disable-lib64
|
||||||
|
MINGW_ARCH_FLAGS_pthread-x86_64 = CFLAGS="-mcmodel=small"
|
||||||
|
MINGW_ARCH_FLAGS_pthread-i686 =
|
||||||
|
|
||||||
define create-mingw-rules
|
define create-mingw-rules
|
||||||
.PHONY: mingw-$(2)-$(1)
|
.PHONY: mingw-$(2)-$(1)
|
||||||
all mingw: mingw-$(2)-$(1)
|
all mingw: mingw-$(2)-$(1)
|
||||||
|
mingw-$(2)-$(1): ARCH_FLAGS = $(MINGW_ARCH_FLAGS_$(2)-$(1))
|
||||||
mingw-$(2)-$(1): mingw-$(2)-$(1).Dockerfile | binutils
|
mingw-$(2)-$(1): mingw-$(2)-$(1).Dockerfile | binutils
|
||||||
rm -rf build; mkdir -p build
|
rm -rf build; mkdir -p build
|
||||||
$(DOCKER) build -f $$< \
|
$(DOCKER) build -f $$< \
|
||||||
@ -146,12 +156,16 @@ $(eval $(call create-mingw-rules,x86_64,crt))
|
|||||||
$(eval $(call create-mingw-rules,x86_64,pthreads))
|
$(eval $(call create-mingw-rules,x86_64,pthreads))
|
||||||
$(eval $(call create-mingw-rules,x86_64,widl))
|
$(eval $(call create-mingw-rules,x86_64,widl))
|
||||||
|
|
||||||
|
GCC_ARCH_FLAGS_x86_64 = CFLAGS_FOR_TARGET="-mcmodel=small" CXXFLAGS_FOR_TARGET="-mcmodel=small"
|
||||||
|
GCC_ARCH_FLAGS_i686 =
|
||||||
|
|
||||||
GCC_TARGET_FLAGS_w64-mingw32 = --disable-shared
|
GCC_TARGET_FLAGS_w64-mingw32 = --disable-shared
|
||||||
GCC_TARGET_FLAGS_linux-gnu =
|
GCC_TARGET_FLAGS_linux-gnu =
|
||||||
|
|
||||||
define create-gcc-rules
|
define create-gcc-rules
|
||||||
.PHONY: gcc-$(1)-$(2)
|
.PHONY: gcc-$(1)-$(2)
|
||||||
all gcc: gcc-$(1)-$(2)
|
all gcc: gcc-$(1)-$(2)
|
||||||
|
gcc-$(1)-$(2): ARCH_FLAGS = $(GCC_ARCH_FLAGS_$(1))
|
||||||
gcc-$(1)-$(2): TARGET_FLAGS = $(GCC_TARGET_FLAGS_$(2))
|
gcc-$(1)-$(2): TARGET_FLAGS = $(GCC_TARGET_FLAGS_$(2))
|
||||||
gcc-$(1)-$(2): gcc-$(1)-$(2).Dockerfile | mingw
|
gcc-$(1)-$(2): gcc-$(1)-$(2).Dockerfile | mingw
|
||||||
rm -rf build; mkdir -p build
|
rm -rf build; mkdir -p build
|
||||||
|
@ -40,6 +40,7 @@ RUN wget -q @GCC_URLBASE@/@GCC_SOURCE@ \
|
|||||||
--with-system-mpfr \
|
--with-system-mpfr \
|
||||||
--with-system-zlib \
|
--with-system-zlib \
|
||||||
--with-tune=core-avx2 \
|
--with-tune=core-avx2 \
|
||||||
|
@ARCH_FLAGS@ \
|
||||||
MAKEINFO=true \
|
MAKEINFO=true \
|
||||||
&& make --quiet -j@J@ MAKEINFO=true CFLAGS="-static --static" LDFLAGS="-s -static --static" \
|
&& make --quiet -j@J@ MAKEINFO=true CFLAGS="-static --static" LDFLAGS="-s -static --static" \
|
||||||
&& make --quiet -j@J@ MAKEINFO=true CFLAGS="-static --static" LDFLAGS="-s -static --static" install-strip DESTDIR=/opt \
|
&& make --quiet -j@J@ MAKEINFO=true CFLAGS="-static --static" LDFLAGS="-s -static --static" install-strip DESTDIR=/opt \
|
||||||
|
@ -13,7 +13,8 @@ RUN wget -q @MINGW_URLBASE@/@MINGW_SOURCE@ \
|
|||||||
--prefix=/usr/@ARCH@-w64-mingw32/ \
|
--prefix=/usr/@ARCH@-w64-mingw32/ \
|
||||||
--host=@ARCH@-w64-mingw32 \
|
--host=@ARCH@-w64-mingw32 \
|
||||||
--enable-wildcard \
|
--enable-wildcard \
|
||||||
MAKEINFO=true || cat config.log \
|
@ARCH_FLAGS@ \
|
||||||
|
MAKEINFO=true \
|
||||||
&& make --quiet -j@J@ MAKEINFO=true \
|
&& make --quiet -j@J@ MAKEINFO=true \
|
||||||
&& make --quiet -j@J@ MAKEINFO=true install-strip DESTDIR=/opt \
|
&& make --quiet -j@J@ MAKEINFO=true install-strip DESTDIR=/opt \
|
||||||
&& rm -rf /opt/usr/share/doc /opt/usr/share/info /opt/usr/share/man \
|
&& rm -rf /opt/usr/share/doc /opt/usr/share/info /opt/usr/share/man \
|
||||||
|
@ -15,6 +15,7 @@ RUN wget -q @MINGW_URLBASE@/@MINGW_SOURCE@ \
|
|||||||
--prefix=/usr/@ARCH@-w64-mingw32/ \
|
--prefix=/usr/@ARCH@-w64-mingw32/ \
|
||||||
--host=@ARCH@-w64-mingw32 \
|
--host=@ARCH@-w64-mingw32 \
|
||||||
--disable-shared \
|
--disable-shared \
|
||||||
|
@ARCH_FLAGS@ \
|
||||||
MAKEINFO=true \
|
MAKEINFO=true \
|
||||||
&& make --quiet -j@J@ MAKEINFO=true \
|
&& make --quiet -j@J@ MAKEINFO=true \
|
||||||
&& make --quiet -j@J@ MAKEINFO=true install-strip DESTDIR=/opt \
|
&& make --quiet -j@J@ MAKEINFO=true install-strip DESTDIR=/opt \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user