From f8d4d6cdc711e90b18b99cb8d1e0834e482ca545 Mon Sep 17 00:00:00 2001 From: BigBlack <840206@qq.com> Date: Thu, 12 Sep 2019 00:26:35 +0800 Subject: [PATCH] compiler: 32-bit option --- compiler/cc.v | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/compiler/cc.v b/compiler/cc.v index 3593fe1700..5750cf9520 100644 --- a/compiler/cc.v +++ b/compiler/cc.v @@ -119,6 +119,7 @@ fn (v mut V) cc() { a << '-mmacosx-version-min=10.7' } cflags := v.get_os_cflags() + // add .o files for flag in cflags { if !flag.value.ends_with('.o') { continue } @@ -315,6 +316,17 @@ fn find_c_compiler_default() string { } fn find_c_compiler_thirdparty_options() string { - $if windows { return '' } - return '-fPIC' + if '-m32' in os.args{ + $if windows { + return '-m32' + }$else{ + return '-fPIC -m32' + } + }else{ + $if windows { + return '' + }$else{ + return '-fPIC' + } + } }