Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tor-browser-build
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Georg Koppen
tor-browser-build
Commits
878a3855
Commit
878a3855
authored
5 years ago
by
Matthew Finkel
Committed by
Georg Koppen
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Bug 32303: Fix broken obfs4 on Android Q
Backport go patch #29674 that drops the TLS section on Android.
parent
eee5d30a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
projects/go/90a3ce02dc25adcf1598faf11a66b151ada3f637.patch
+57
-0
57 additions, 0 deletions
projects/go/90a3ce02dc25adcf1598faf11a66b151ada3f637.patch
projects/go/build
+2
-0
2 additions, 0 deletions
projects/go/build
projects/go/config
+2
-0
2 additions, 0 deletions
projects/go/config
with
61 additions
and
0 deletions
projects/go/90a3ce02dc25adcf1598faf11a66b151ada3f637.patch
0 → 100644
+
57
−
0
View file @
878a3855
From 90a3ce02dc25adcf1598faf11a66b151ada3f637 Mon Sep 17 00:00:00 2001
From: Elias Naur <mail@eliasnaur.com>
Date: Wed, 27 Mar 2019 14:25:24 +0100
Subject: [PATCH] cmd/link/internal/ld: skip TLS section on Android
We don't use the TLS section on android, and dropping it avoids
complaints about underalignment from the Android Q linker.
Updates #29674
Change-Id: I91dabf2a58e6eb1783872639a6a144858db09cef
Reviewed-on: https://go-review.googlesource.com/c/go/+/169618
Reviewed-by: Ian Lance Taylor <iant@golang.org>
---
src/cmd/link/internal/ld/lib.go | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index 1d44c0eb18b..b331e39fe3e 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -453,18 +453,23 @@
func (ctxt *Link) loadlib() {
}
}
- tlsg := ctxt.Syms.Lookup("runtime.tlsg", 0)
-
- // runtime.tlsg is used for external linking on platforms that do not define
- // a variable to hold g in assembly (currently only intel).
- if tlsg.Type == 0 {
- tlsg.Type = sym.STLSBSS
- tlsg.Size = int64(ctxt.Arch.PtrSize)
- } else if tlsg.Type != sym.SDYNIMPORT {
- Errorf(nil, "runtime declared tlsg variable %v", tlsg.Type)
- }
- tlsg.Attr |= sym.AttrReachable
- ctxt.Tlsg = tlsg
+ // The Android Q linker started to complain about underalignment of the our TLS
+ // section. We don't actually use the section on android, so dont't
+ // generate it.
+ if objabi.GOOS != "android" {
+ tlsg := ctxt.Syms.Lookup("runtime.tlsg", 0)
+
+ // runtime.tlsg is used for external linking on platforms that do not define
+ // a variable to hold g in assembly (currently only intel).
+ if tlsg.Type == 0 {
+ tlsg.Type = sym.STLSBSS
+ tlsg.Size = int64(ctxt.Arch.PtrSize)
+ } else if tlsg.Type != sym.SDYNIMPORT {
+ Errorf(nil, "runtime declared tlsg variable %v", tlsg.Type)
+ }
+ tlsg.Attr |= sym.AttrReachable
+ ctxt.Tlsg = tlsg
+ }
var moduledata *sym.Symbol
if ctxt.BuildMode == BuildModePlugin {
This diff is collapsed.
Click to expand it.
projects/go/build
+
2
−
0
View file @
878a3855
...
...
@@ -68,6 +68,8 @@ cd /var/tmp/dist/go/src
CGO_ENABLED
=
1
CC_FOR_TARGET
=
"
$CC_FOR_TARGET
"
CC
=
CFLAGS
=
LDFLAGS
=
.
/
make
.
bash
[
%
ELSIF
c
(
"
var/android
"
)
-%
]
patch
-
p2
<
$
rootdir
/
0001
-
Use
-
fixed
-
go
-
build
-
tmp
-
directory
.
patch
# Obfs4 breaks on Android Q without this patch, see: #32303
patch
-
p2
<
$
rootdir
/
90
a3ce02dc25adcf1598faf11a66b151ada3f637
.
patch
CGO_ENABLED
=
1
CC_FOR_TARGET
=
[
%
c
(
"
var/CC
"
)
%
]
CGO_CFLAGS
=
'
-D__ANDROID_API__=[% c(
"
var/android_min_api
"
) %]
'
CC
=
CFLAGS
=
LDFLAGS
=
.
/
make
.
bash
[
%
END
-%
]
...
...
This diff is collapsed.
Click to expand it.
projects/go/config
+
2
−
0
View file @
878a3855
...
...
@@ -118,3 +118,5 @@ input_files:
sha256sum
:
9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959
-
filename
:
0001-Use-fixed-go-build-tmp-directory.patch
enable
:
'
[%
c("var/android")
%]'
-
filename
:
90a3ce02dc25adcf1598faf11a66b151ada3f637.patch
enable
:
'
[%
c("var/android")
%]'
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment