[swift-users] what is the use of "-frontend" argument to swift?
Frank Swarbrick
fswarbrick at gmail.com
Wed Dec 6 02:29:13 CST 2017
If you compile with the -v option you’ll see how -frontend is used, (below, with some comments by me):
frank at DESKTOP-6Q7P3OK:~/src/swift$ swiftc -v -module-name CTest CTest.swift ../c/CTest.o
Swift version 4.0.2 (swift-4.0.2-RELEASE)
Target: x86_64-unknown-linux-gnu
Compile:
/home/frank/swift-4.0.2-RELEASE-ubuntu16.04/usr/bin/swift -frontend -c -primary-file CTest.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -color-diagnostics -module-name CTest -o /tmp/CTest-f4b853.o
Extract “autolink data”:
/home/frank/swift-4.0.2-RELEASE-ubuntu16.04/usr/bin/swift-autolink-extract /tmp/CTest-f4b853.o ../c/CTest.o -o /tmp/CTest-8bd3ee.autolink
Link:
/usr/bin/clang++ -fuse-ld=gold -target x86_64-unknown-linux-gnu -Xlinker -rpath -Xlinker /home/frank/swift-4.0.2-RELEASE-ubuntu16.04/usr/lib/swift/linux /home/frank/swift-4.0.2-RELEASE-ubuntu16.04/usr/lib/swift/linux/x86_64/swift_begin.o /tmp/CTest-f4b853.o ../c/CTest.o -L /home/frank/swift-4.0.2-RELEASE-ubuntu16.04/usr/lib/swift/linux -lswiftCore --target=x86_64-unknown-linux-gnu @/tmp/CTest-8bd3ee.autolink /home/frank/swift-4.0.2-RELEASE-ubuntu16.04/usr/lib/swift/linux/x86_64/swift_end.o -o CTest
From: swift-users-bounces at swift.org [mailto:swift-users-bounces at swift.org] On Behalf Of Atul Sowani via swift-users
Sent: Tuesday, December 5, 2017 11:10 PM
To: swift-users at swift.org
Subject: Re: [swift-users] what is the use of "-frontend" argument to swift?
Thanks Kyle and Jordan! That's the information I was looking for. Anyway I am not using these options explicitly, but found that they are invoked while Swift test suite is run. A few test cases are failing for me on ppc64le and while analyzing it I came across these options. Thanks for the info!
Best regards,
Atul.
On Wed, Dec 6, 2017 at 4:16 AM, Jordan Rose <jordan_rose at apple.com <mailto:jordan_rose at apple.com> > wrote:
-c is an alias for -emit-object. -frontend is "magically start talking to Swift's implementation details" and you shouldn't use it. More info in docs/Driver.md <https://github.com/apple/swift/blob/master/docs/Driver.md> .
Jordan
On Dec 5, 2017, at 14:23, Kyle Murray via swift-users <swift-users at swift.org <mailto:swift-users at swift.org> > wrote:
Looks like it's an alias for -emit-object:
https://github.com/apple/swift/blob/master/include/swift/Option/Options.td#L576
...which will give an object file as output rather than the default, an executable.
-Kyle
On Dec 5, 2017, at 1:49 AM, Atul Sowani via swift-users <swift-users at swift.org <mailto:swift-users at swift.org> > wrote:
Hi,
What is the purpose of "-frontend -c" arguments of swift? I tried "swift --help" but that does not mention it. Also I couldn't find it easily in any swift documents. Can somebody kindly let me know the purpose of these arguments?
Thanks,
Atul.
_______________________________________________
swift-users mailing list
swift-users at swift.org <mailto:swift-users at swift.org>
https://lists.swift.org/mailman/listinfo/swift-users
_______________________________________________
swift-users mailing list
swift-users at swift.org <mailto:swift-users at swift.org>
https://lists.swift.org/mailman/listinfo/swift-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171206/d8a0e9bf/attachment.html>
More information about the swift-users
mailing list