Skip to content

Commit 40dab52

Browse files
committed
---
yaml --- r: 347636 b: refs/heads/master c: 76e02b6 h: refs/heads/master
1 parent 4afd435 commit 40dab52

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 9da051c4e62281ac88aea15297eb5ba71a5cf793
2+
refs/heads/master: 76e02b6b4413b47c3c60ec035727b5d50bc97651
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/SwiftRemoteMirror/SwiftRemoteMirror.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
extern "C" {
3838
#endif
3939

40-
SWIFT_REMOTE_MIRROR_LINKAGE
40+
SWIFT_REMOTE_MIRROR_LINKAGE __attribute__((__weak_import__))
4141
extern unsigned long long swift_reflection_classIsSwiftMask;
4242

4343
/// Get the metadata version supported by the Remote Mirror library.

trunk/stdlib/public/SwiftRemoteMirror/SwiftRemoteMirror.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#define SWIFT_CLASS_IS_SWIFT_MASK swift_reflection_classIsSwiftMask
1616
extern "C" {
17-
SWIFT_REMOTE_MIRROR_LINKAGE
17+
SWIFT_REMOTE_MIRROR_LINKAGE __attribute__((__weak_import__))
1818
unsigned long long swift_reflection_classIsSwiftMask = 2;
1919
}
2020

trunk/stdlib/tools/swift-reflection-test/swift-reflection-test.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,10 @@ int main(int argc, char *argv[]) {
576576

577577
const char *BinaryFilename = argv[1];
578578

579-
swift_reflection_classIsSwiftMask = computeClassIsSwiftMask();
579+
// swift_reflection_classIsSwiftMask is weak linked so we can work
580+
// with older Remote Mirror dylibs.
581+
if (&swift_reflection_classIsSwiftMask != NULL)
582+
swift_reflection_classIsSwiftMask = computeClassIsSwiftMask();
580583

581584
uint16_t Version = swift_reflection_getSupportedMetadataVersion();
582585
printf("Metadata version: %u\n", Version);

trunk/utils/remote-run

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,19 @@ class CommandRunner(object):
9494
sys.exit(sftp_proc.returncode)
9595

9696
class RemoteCommandRunner(CommandRunner):
97-
def __init__(self, host, identity_path, ssh_options):
97+
def __init__(self, host, identity_path, ssh_options, config_file):
9898
if ':' in host:
9999
(self.remote_host, self.port) = host.rsplit(':', 1)
100100
else:
101101
self.remote_host = host
102102
self.port = None
103103
self.identity_path = identity_path
104104
self.ssh_options = ssh_options
105+
self.config_file = config_file
105106

106107
def common_options(self, port_flag):
107108
port_option = [port_flag, self.port] if self.port else []
109+
config_option = ['-F', self.config_file] if self.config_file else []
108110
identity_option = (
109111
['-i', self.identity_path] if self.identity_path else [])
110112
# Interleave '-o' with each custom option.
@@ -113,7 +115,7 @@ class RemoteCommandRunner(CommandRunner):
113115
# https://spapas.github.io/2016/04/27/python-nested-list-comprehensions/
114116
extra_options = [arg for option in self.ssh_options
115117
for arg in ["-o", option]]
116-
return port_option + identity_option + extra_options
118+
return port_option + identity_option + config_option + extra_options
117119

118120
def remote_invocation(self, command):
119121
return (['/usr/bin/ssh', '-n'] +
@@ -172,6 +174,8 @@ def main():
172174

173175
parser.add_argument('-i', '--identity', dest='identity', metavar='FILE',
174176
help='an SSH identity file (private key) to use')
177+
parser.add_argument('-F', '--config-file', dest='config_file', metavar='FILE',
178+
help='an SSH configuration file')
175179
parser.add_argument('-o', '--ssh-option', action='append', default=[],
176180
dest='ssh_options', metavar='OPTION',
177181
help='extra SSH config options (man ssh_config)')
@@ -192,7 +196,10 @@ def main():
192196
args.command.insert(0, args.host)
193197
del args.host
194198
else:
195-
runner = RemoteCommandRunner(args.host, args.identity, args.ssh_options)
199+
runner = RemoteCommandRunner(args.host,
200+
args.identity,
201+
args.ssh_options,
202+
args.config_file)
196203
runner.dry_run = args.dry_run
197204
runner.verbose = args.verbose or args.dry_run
198205

0 commit comments

Comments
 (0)