Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Oct 12, 2023
1 parent b332665 commit dc71158
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion internal/cmd/buildtool/android.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func androidSubcommand() *cobra.Command {
})

cmd.AddCommand(&cobra.Command{
Use: "cdeps {zlib|openssl|libevent|tor} [zlib|openssl|libevent|tor...]",
Use: "cdeps [zlib|openssl|libevent|tor...]",
Short: "Cross compiles C dependencies for Android",
Run: func(cmd *cobra.Command, args []string) {
for _, arg := range args {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ type Dependencies interface {
WindowsMingwCheck()

// XCRun executes Xcode's xcrun tool with the given arguments and returns
// the output emitted by xcrun or panics on failure.
// the first line of text emitted by xcrun or PANICS on failure.
XCRun(args ...string) string
}
11 changes: 3 additions & 8 deletions internal/cmd/buildtool/ios.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func iosSubcommand() *cobra.Command {
})

cmd.AddCommand(&cobra.Command{
Use: "cdeps {zlib|openssl|libevent|tor} [zlib|openssl|libevent|tor...]",
Use: "cdeps [zlib|openssl|libevent|tor...]",
Short: "Cross compiles C dependencies for iOS",
Run: func(cmd *cobra.Command, args []string) {
for _, arg := range args {
Expand Down Expand Up @@ -66,10 +66,7 @@ func iosBuildGomobile(deps buildtoolmodel.Dependencies) {

// iosCdepsBuildMain builds C dependencies for ios.
func iosCdepsBuildMain(name string, deps buildtoolmodel.Dependencies) {
runtimex.Assert(
runtime.GOOS == "darwin",
"this command requires darwin or linux",
)
runtimex.Assert(runtime.GOOS == "darwin", "this command requires darwin")

// The ooni/probe-ios app explicitly only targets amd64 and arm64. It also targets
// as the minimum version iOS 12, while one cannot target a version of iOS > 10 when
Expand Down Expand Up @@ -168,7 +165,7 @@ func iosNewCBuildEnv(deps buildtoolmodel.Dependencies, ooniArch string) *cBuildE
"-O2",
},
GOARCH: ooniArch,
GOARM: "", // maybe later
GOARM: "", // not needed
LD: deps.XCRun("-find", "-sdk", platform, "ld"),
LDFLAGS: []string{
"-isysroot", isysroot,
Expand All @@ -188,11 +185,9 @@ func iosNewCBuildEnv(deps buildtoolmodel.Dependencies, ooniArch string) *cBuildE
switch ooniArch {
case "arm64":
out.CONFIGURE_HOST = "arm-apple-darwin"
out.GOARM = ""
out.OPENSSL_COMPILER = "ios64-xcrun"
case "amd64":
out.CONFIGURE_HOST = "x86_64-apple-darwin"
out.GOARM = ""
out.OPENSSL_COMPILER = "iossimulator-xcrun"
default:
panic(errors.New("unsupported ooniArch"))
Expand Down

0 comments on commit dc71158

Please sign in to comment.