@@ -103,28 +103,15 @@ def add_target_env(env, build_platform, target_triple, build_env):
103
103
if build_platform == "linux64" :
104
104
env ["BUILD_TRIPLE" ] = "x86_64-unknown-linux-gnu"
105
105
106
- if target_triple == "aarch64-unknown-linux-gnu" :
107
- env ["TARGET_TRIPLE" ] = "aarch64-unknown-linux-gnu"
108
- elif target_triple == "armv7-unknown-linux-gnueabi" :
109
- env ["TARGET_TRIPLE" ] = "armv7-unknown-linux-gnueabi"
110
- elif target_triple == "armv7-unknown-linux-gnueabihf" :
111
- env ["TARGET_TRIPLE" ] = "armv7-unknown-linux-gnueabihf"
112
- elif target_triple == "mips-unknown-linux-gnu" :
113
- env ["TARGET_TRIPLE" ] = "mips-unknown-linux-gnu"
114
- elif target_triple == "mipsel-unknown-linux-gnu" :
115
- env ["TARGET_TRIPLE" ] = "mipsel-unknown-linux-gnu"
116
- elif target_triple == "mips64el-unknown-linux-gnuabi64" :
117
- env ["TARGET_TRIPLE" ] = "mips64el-unknown-linux-gnuabi64"
118
- elif target_triple == "s390x-unknown-linux-gnu" :
119
- env ["TARGET_TRIPLE" ] = "s390x-unknown-linux-gnu"
120
- elif target_triple in ("x86_64-unknown-linux-gnu" , "x86_64-unknown-linux-musl" ):
106
+ # TODO should the musl target be normalized?
107
+ if target_triple == "x86_64-unknown-linux-musl" :
121
108
env ["TARGET_TRIPLE" ] = "x86_64-unknown-linux-gnu"
122
- elif target_triple == "i686-unknown-linux-gnu" :
123
- env ["TARGET_TRIPLE" ] = "i686-unknown-linux-gnu"
109
+ else :
110
+ env ["TARGET_TRIPLE" ] = target_triple
111
+
112
+ if target_triple == "i686-unknown-linux-gnu" :
124
113
extra_target_cflags .append ("-m32" )
125
114
extra_target_ldflags .append ("-m32" )
126
- else :
127
- raise Exception ("unhandled target triple: %s" % target_triple )
128
115
129
116
if build_platform == "macos" :
130
117
machine = platform .machine ()
0 commit comments