Initial check in
Bug: 137197907
diff --git a/vendor/rustc-ap-rustc_target/.cargo-checksum.json b/vendor/rustc-ap-rustc_target/.cargo-checksum.json
new file mode 100644
index 0000000..a412293
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"4f02e1c961f0535a744d0cd90296ff83df864c98e504e69e7361fd9994d73c81","README.md":"c013962cef1fc128dda49a46a1305b7a3dd408efda1b6d78f09c52709e239b28","abi/call/aarch64.rs":"2c35c323aac84bce15d06e9a034992746cd3b79906692476bb4029385c4030f3","abi/call/amdgpu.rs":"004e859894737a4600d9f57815b4d77a645fd0c0ebaa2783950fa03b07eac4fa","abi/call/arm.rs":"b400c402d1a5d1f4a8b469793075f5dfd7187aa8f0860aaddf24386a34f9bb39","abi/call/asmjs.rs":"9342931d0c724a6e697c96031b0c8611c831578faedbc794baba518e00792c7b","abi/call/hexagon.rs":"94181abaeca2a9a531dab275fec07431b0762ccc311bc9937093df46cb9b0ccf","abi/call/mips.rs":"aa39133b3cde9c4d98b57543b6d9e50b2ea20c0193ca62dc8c6216904ad33451","abi/call/mips64.rs":"a0cab6819ebbbec27d3fb6aea807829fe07eff039f174d4bda682b71d14f767b","abi/call/mod.rs":"aa9ee892c68a992bcf8875fbee412e29077b31a182b4805701c4bd959440d834","abi/call/msp430.rs":"cbe1e2a2b5fa021226b6adf056fc890b81b2bd91d7a40b2589a502adcf8824b2","abi/call/nvptx.rs":"8f8deb2f4c48ca81afc2a806abbae1c9ed4ddc4bb3ce521a88525446491ad602","abi/call/nvptx64.rs":"6ae3a5a3155cea6b1e60fa852d675ba59f02e9c7cfc138a676900dbfbc21a470","abi/call/powerpc.rs":"aa39133b3cde9c4d98b57543b6d9e50b2ea20c0193ca62dc8c6216904ad33451","abi/call/powerpc64.rs":"b8e6800a117ebfc9b1028ecb0c1cb96243c511fb1ce4207e797860abf1027de4","abi/call/riscv.rs":"3f0d62fc64152f5d7ff20f7d3eb8be7d632aaea85e51c9260f0776f4d47c44f9","abi/call/s390x.rs":"7f07504d35305f19d6871ee988353f1859ffe124c678c12d638e733a86512a8e","abi/call/sparc.rs":"aa39133b3cde9c4d98b57543b6d9e50b2ea20c0193ca62dc8c6216904ad33451","abi/call/sparc64.rs":"a4d6f29e1f9b0f54f497bfb79109884171a8984bfd151da4f25471ddd9159c24","abi/call/wasm32.rs":"f73b343c9381e14a2c6ff5030101b47c8bc2bb5751e793a8a1ffa1e06e34dee1","abi/call/x86.rs":"e601f4728259c5dabe1729c6b4a6f229ea9ebe41ae9fc153e12af79492f9c8a0","abi/call/x86_64.rs":"502f1495db46ba8905da3f9b2e3188251dadbe89e4c3028a45d8c188c2004fc4","abi/call/x86_win64.rs":"6cd2d220c192b810cdfbe92e16c8a15dcaf6d51eab888c22a2245a75a6c141c1","abi/mod.rs":"a9a6676c6b33ad74448fd833d0d78058df8808d45eb61118ee573f32d152f682","build.rs":"d0ca3d7c2937be7fdb81ea99545564abf90ac56594629aab865708fb20df6269","lib.rs":"02ea9be7eb3dfeb9467a7c3341a0557388da5ae245681d3b5d1572b5ca705785","spec/aarch64_apple_ios.rs":"9b99dded4048987e2989a89fcab80f157af9880927d38ce74d7c20778e7f5c23","spec/aarch64_fuchsia.rs":"2c43491b8696b8f4e9a7b55ec89cf6ea3d376e5f6faf24094c00e204648f3caf","spec/aarch64_linux_android.rs":"44a4bbee503e8b6d89b6ce74a5d38d84edd52785888b180967a27600c014562a","spec/aarch64_pc_windows_msvc.rs":"958c763a072b151e00a59fb2a897af2bc676c9c3b270408442c38f66d4a7414c","spec/aarch64_unknown_cloudabi.rs":"fd8f62f1b0b5f1d6911a764bd1a21db5a787fd365d1ce87500c0abdfa04974bf","spec/aarch64_unknown_freebsd.rs":"eff423e657b0cc4c3d63706e0e3e52e81124941275fe95d9fc4cfed331c20c15","spec/aarch64_unknown_hermit.rs":"dfecea93bf8046a53ea6c30bfe6886973283f41eb5de21d4322ad31a850a6247","spec/aarch64_unknown_linux_gnu.rs":"94938e2a56a48fba6c971b13780d78be28010f855b2d3c7d97066c83c7c3b76f","spec/aarch64_unknown_linux_musl.rs":"61c0caab1f47750af8a5605bbd40536f1a8c43aa7531a15417182fc9b151e802","spec/aarch64_unknown_netbsd.rs":"f537eba392a11625b4ace1717504f8350e7056e5d38d4d1459d74e9ba7d2f02c","spec/aarch64_unknown_none.rs":"ca0ee59a7e2480c6607cfbbf4411ea40a19ec851aa1d72b1accd5c99884a2761","spec/aarch64_unknown_openbsd.rs":"eab8d7bd133aaf6f35ae674b03f1295407f3880090a7edfdd356c3624be315bb","spec/abi.rs":"4e243506bd5289bd826e42993fc91b84fd6ba72a226bd96efb2114a897933e7b","spec/android_base.rs":"2703ac12d91457c818728e8b8a7e4a1847e16ef5ad1edbf4e34b2f68ded13ae5","spec/apple_base.rs":"754296c8f116b9e12f571c1bc97bef90321336e8fb3cef0d92920abce87d0ef7","spec/apple_ios_base.rs":"b6a026c6de038603740360f0d09eedd3761e70eb73ae89b82dc20bc0e60c65c0","spec/arm_base.rs":"7936b7950182550fe82b6d29b73039df68339666a9892a3f7711f452dfa1ffe4","spec/arm_linux_androideabi.rs":"0066de689a14a094290f2fd66624ae345420ac8b6df8b028f02c100d4a9cf0cf","spec/arm_unknown_linux_gnueabi.rs":"ec53f45c92810667ce1ef3fa46ad4d8ad34636160f6e3f1d8ec2c4a0ffb035bf","spec/arm_unknown_linux_gnueabihf.rs":"b57962b32b5f13c1de38161896853edb018dbe35f6b938eb9656661d6ec2f4e0","spec/arm_unknown_linux_musleabi.rs":"2f3fe7031d50b9695661e9a1556ffe12c3b6eb2855f56f78855a5442b5b8632d","spec/arm_unknown_linux_musleabihf.rs":"b6481f0863cdb2eb8c79288f665680dd34e2d141fbc3abe0165c7d70e8efeb53","spec/armebv7r_none_eabi.rs":"9dc276c0acabb5c994a9d5dee02b33acc82079d934f266483b68c5071c6c9d22","spec/armebv7r_none_eabihf.rs":"0358a1833d3452258dacaaa1c1abda8d26f4ea1ecb143a53270ddefbda13091c","spec/armv4t_unknown_linux_gnueabi.rs":"03aa9851b8c9a83df6c6c8e3cd4a07f70be79785d929484efdb89d99ab985206","spec/armv5te_unknown_linux_gnueabi.rs":"8646abcd83fe236131f5359a76f7801310ab64b37c0353d81e49ccfcd984cbc6","spec/armv5te_unknown_linux_musleabi.rs":"b54aeb7d523d322ba3741aa7e5d755ce21d60eb727a825b0c625f78e60d8e422","spec/armv6_unknown_freebsd.rs":"c265f1019f10b06659ab014c1fb8379fc46f73c0066eb212dd22f2a596f27d0d","spec/armv6_unknown_netbsd_eabihf.rs":"962b5a9319692268cc138a8f100364c8353df6128159b1d51d3d8c17c64f3df9","spec/armv7_apple_ios.rs":"8427a7941c89ae73668b61694c163e61348ab23b1dd39b9cec19d91570eeba7c","spec/armv7_linux_androideabi.rs":"78972530536239d4087986ba7bea7acc6fd3adf876c8f0338afb9bb0e20564bb","spec/armv7_unknown_cloudabi_eabihf.rs":"3d9a2faf47a677a36a41e41a4cf8bfa4e31a42a7cf05a38ec377a68df0472b2f","spec/armv7_unknown_freebsd.rs":"0e717581613dde7366fd59d68d546cb8e0a1db6c7ba86129d9558b77afd4df63","spec/armv7_unknown_linux_gnueabihf.rs":"6b0e90eb67152669b1266bc5ded80f9db243b514747a2ade40ea73065097feba","spec/armv7_unknown_linux_musleabihf.rs":"7c892b6a41700567c7aa3410d070a2fae5c3b7d7e3292ac739e8794f9d06aac6","spec/armv7_unknown_netbsd_eabihf.rs":"8410ebdcc50894a4643f1377f7650c6e1a129e47eb74b6cd5cc681e227639643","spec/armv7r_none_eabi.rs":"aeaab625d4d701184810612e60a768ad1dc90733a4b168a96584efb8581c9030","spec/armv7r_none_eabihf.rs":"3d5a0a4813fcc70238f645254e7c50ad25418cdaf0eaa6c947ff8731b79e84ad","spec/armv7s_apple_ios.rs":"2f6d4b20b9a027dbd31deb47df80cc369be9059bd128ebfae7bc2316569a7db9","spec/asmjs_unknown_emscripten.rs":"77bfd6961456fca4f9472eb1e6ed29ff4f79a6411d690ae9c9444599ba6fa751","spec/bitrig_base.rs":"66d605908b2ca86028b380c1da4d244820e5b96e5c17a68cf695f613596e6a41","spec/cloudabi_base.rs":"1c4f5e32238b8ac6bb4c50b26633e66b2702a62813c522593b94138064d2d649","spec/dragonfly_base.rs":"8050c2493e13d26e222c8647ddc76098d72bec1966b8a0c432798f6397d8582c","spec/freebsd_base.rs":"312f1a777f4870ab2edf7e847694be69061fd37dec0f58b279e173b28aeee053","spec/fuchsia_base.rs":"c634852ab74e35f0888added096e54dd4d0fc03e2c0057fca3466c9eee6ab22a","spec/haiku_base.rs":"9e61351a94e8fa8a2534fcb7ee2746fe2b6ef54c6e995b30ea129e0f4d02f9d7","spec/hermit_base.rs":"0d7f4641154351a868e075ce507b4b1da07030ee1ea0d28f74694859c8bee36f","spec/i386_apple_ios.rs":"19596ac5a155e667cac1abe6bd7f3f52dac99b99443d25057b765a305078d351","spec/i586_pc_windows_msvc.rs":"29d75fd28ca0dd65b931f8088563b3238531b24768aab299ca1106a6cdb4ead6","spec/i586_unknown_linux_gnu.rs":"62e81eac9a468893a638e4225f6158219ec7f45d7ef2a549d99d6985040d0da7","spec/i586_unknown_linux_musl.rs":"55a04d0711f1bbe588827d0263a0c167dc87a4cc1a818838f2adb4de99ae267f","spec/i686_apple_darwin.rs":"0f4b017670f1e1ce1f7215c10304bb7e542df3ba883a4e7e5ba4a3e906da8adb","spec/i686_linux_android.rs":"b3b4ba1207d3dd3d82270d2003ca42bdab488825074091a93789d1c5f280964e","spec/i686_pc_windows_gnu.rs":"07e4af323c6eb871b353b1a3b8c24819fee3c8592ae72c88214f8d1dfe6ea321","spec/i686_pc_windows_msvc.rs":"358f120c3abb190edf3bd0e96f054f64e45f1782f8654e3bc6191d6f4065f3ce","spec/i686_unknown_cloudabi.rs":"9a721359b053beea6fd1cea4de760ead7e032478373974f985936efcda3eabd2","spec/i686_unknown_dragonfly.rs":"80aa331934cc1d2bd3649c8e153454d782da3ff3610cf277a5dced3d2f15f3ec","spec/i686_unknown_freebsd.rs":"868b58b0e984dc2e785df5f5dfde70f24e0295117463901119313e360b06fd1a","spec/i686_unknown_haiku.rs":"0e75183af6ac5d996f0dbfe714919c80464069bb85ce29ec8b6113d5504914ec","spec/i686_unknown_linux_gnu.rs":"a75a6025d7e3424edf9baf3039056c0f8eea157631a175d00ac5a218aa54b510","spec/i686_unknown_linux_musl.rs":"8cc54fbc7fad2383e1839ac8c536b9131e4073a973432865a7f93d743eb24f59","spec/i686_unknown_netbsd.rs":"b19b12a85400c15049918103d6f250dc5b015af8ae2ee7ce5d8e68645c7fc6ef","spec/i686_unknown_openbsd.rs":"919eec33494d2be8c92398d90c8cd15fc362f7f3ac79b0f497bd031e77ef964d","spec/l4re_base.rs":"41c089e734e153e10d771ee02d489494a229a2e5582138ab5a6aaf9f597bb683","spec/linux_base.rs":"bba1a92e93309a8ee0f237287d190bbab686d31c159cd5bc60342faa77e00fd3","spec/linux_musl_base.rs":"f9323f61d10af8b4ab88ec2b887fc4f03be1d776412c896d819c61f4d00f6700","spec/mips64_unknown_linux_gnuabi64.rs":"f98959ce80c4bf8b92a9f881307d4eaced02fc00685591447d204f0e8b15258f","spec/mips64el_unknown_linux_gnuabi64.rs":"979bfed718fb35db9c8e694ef31af0c495ed8bb65fd35c812f4bc3ea84503c13","spec/mips_unknown_linux_gnu.rs":"a338840337d7fa71ba8eb690ba9cf2f8a6572088bc4fe22e03e8db2efba3911d","spec/mips_unknown_linux_musl.rs":"6db7ca09af1127970a13da04746b84f7a2d3710f0b44210463a9c8c2ae69bb2c","spec/mips_unknown_linux_uclibc.rs":"69ef2f7467ddf85bb613d0ac7620d061ed667fa719eb7c966ed07c8d74ba5406","spec/mipsel_unknown_linux_gnu.rs":"8be5db5b402172ee63840531e69d176752e39ff4cdfe2a6344033231feca48a2","spec/mipsel_unknown_linux_musl.rs":"695fee10cd902cd1c5aa60d1a09aa1eea32c6b165c9bef21ca39daad3194c08c","spec/mipsel_unknown_linux_uclibc.rs":"e849cbab8fdf51b58f96d2cd6c1154f274356742ff1cdd45a99f6f25fa530bb3","spec/mod.rs":"771a262fb530920be4cf04a238060874258a66ea3bf2043a97bf9d97c81ec19b","spec/msp430_none_elf.rs":"d8c045b377b02b6c8a1909aa5fb4b2d850a3ef3f5a648a22a16533b05845807e","spec/netbsd_base.rs":"e3d42dca1c1fe5aab01e244b82aebf59626d1c53150496331a3cfc6dd5b03280","spec/nvptx64_nvidia_cuda.rs":"f8affba9133d96c226b9e5b581a939b0fcb01c469b4dd2e9dbc0163e1fd3f71c","spec/openbsd_base.rs":"3cbc96cdc48e12d08199ecb3c511b24b5ae95787737309cf2cfdf72469b46720","spec/powerpc64_unknown_freebsd.rs":"8323dd94931af2a465074ce05137ad987d776c7ddd7f209da842381c269d08b4","spec/powerpc64_unknown_linux_gnu.rs":"ba76b2a150bc656fda0a78de375d40683632c03738db4e71ea2e0fbc88e8b66b","spec/powerpc64_unknown_linux_musl.rs":"e7fefcb262e52d97db6e0cc2e5ea4808d28453703bd9f71608746bca55a1414a","spec/powerpc64le_unknown_linux_gnu.rs":"cc59c45ca95552b446e88f61b422f62c452b517bc8d54422da2c9f4693f3706c","spec/powerpc64le_unknown_linux_musl.rs":"b20d8b2b108d66681a9ec262d3875bbe5e3e03f4fc8eba867e60dd236bdecfe9","spec/powerpc_unknown_linux_gnu.rs":"1134be5155c7358ebc1a459530c3eec2a81abcb1fa4b0044f45cd597c46633c7","spec/powerpc_unknown_linux_gnuspe.rs":"ae9373edb076edc63824972b12d38ae4380410daf4aaddd3443e2fac2462f618","spec/powerpc_unknown_linux_musl.rs":"8e35f750c196e15a80a79fb2d8520ebda3682a7cc9075679bf755da16c0a2396","spec/powerpc_unknown_netbsd.rs":"a7dbe8c06816895ed3f392e7225f326a5414dbf39ab2a5a39c802e72c9ab840e","spec/redox_base.rs":"6a0db9831990719e6c5ed70ea49040b122bf4fec4b350a1161412ebdbf957b75","spec/riscv32imac_unknown_none_elf.rs":"f0219149c4db96b437d64417b911f898303b774e688b3c258b14e1950d64403b","spec/riscv32imc_unknown_none_elf.rs":"143d509f8c287bcb6e2e497b4e1a9ae1d21752b04746051ee4c38e029393782c","spec/riscv64gc_unknown_none_elf.rs":"197715390ed7d73e9a1c421857d810e628a86266a715a9a265008c7b7d56a0a1","spec/riscv64imac_unknown_none_elf.rs":"f4ddc7d03fa2d97cf40170afeb90b093b79b414cd4cdb080fa0157d9392fe548","spec/riscv_base.rs":"2b0509f72438fb22db279e5004ef2a151cd544d6e38ceed816381d00c5a08c8f","spec/s390x_unknown_linux_gnu.rs":"884f6a04bf8ba61e071b80247425a769a9190f3a3cb54bc260d07ce1e68f5b80","spec/solaris_base.rs":"0f0fce4fb81611190e72021551b20ed2c8762ccc5fc06a613ef08a8e31544cc2","spec/sparc64_unknown_linux_gnu.rs":"6539ffe6953e2203a32b4c444b1878a47c852b3440ec443a3fb3078866ea1f3f","spec/sparc64_unknown_netbsd.rs":"c0fd0edbb517e1c5f6a35e71ad53b5552486ff19e4d8d662a7a7e78a809d217c","spec/sparc_unknown_linux_gnu.rs":"ded012ad45b7a4151c7ca163505d653dd71cc9758136a900785bec979d638381","spec/sparcv9_sun_solaris.rs":"0924a3bba2a53cc55ca2ada5084d5222f2a3c4ba43da2475c661db214e5e121b","spec/thumb_base.rs":"13aa4684cda51baba54d24e81390ee6661705d62260326e4bba80af7f70900d6","spec/thumbv6m_none_eabi.rs":"7839b744a7bb679ced07a13373573eb22388849b9d86f0d74c55a139055c1ddc","spec/thumbv7a_pc_windows_msvc.rs":"b989d26e5ed2246b3a4535047d07d3dab3dac05c7da020c00e6ce405bf36f809","spec/thumbv7em_none_eabi.rs":"a4ff1774d9272c3ad2c0d3bf9e49e654b630181c06bd008e292ab2e71fd5f98f","spec/thumbv7em_none_eabihf.rs":"ddfec3b7cbea73a65dec7aed835005e14416555f153ab7debb73ab2bee875fbf","spec/thumbv7m_none_eabi.rs":"124aa785a09d0d5cd54ae30f0252c06a69efe260423768d5a7435410bf037b19","spec/thumbv7neon_linux_androideabi.rs":"c38f9278860fb47728d2ec23cec1e51b36df7f4a97879333338f843e5c824e99","spec/thumbv7neon_unknown_linux_gnueabihf.rs":"08e0f7bee53918527c17637563a1f2777e3e8573401f5f660e097f2a5d401808","spec/thumbv8m_base_none_eabi.rs":"f49cf4e0f2d0fbc29e4b4abec61fad216804da59419ee7032d371319b23954ba","spec/thumbv8m_main_none_eabi.rs":"930be03436d93b819ee8f1db8d5e1ad209e611481f4dfea567d6d78b0d2398e3","spec/thumbv8m_main_none_eabihf.rs":"5d30ca0a831d9bb75b24aa4da19f8c29c3e2fe9ef3fcce6d74f5364c10d7b0af","spec/uefi_base.rs":"8c98e74da3a1c412ff44a832a6d3e44f477b08f0ce76df4e2861271cf0bfe558","spec/wasm32_experimental_emscripten.rs":"c4846a05795ccc4801dd268aad8d0941db0a9ac870645e3f26f5a59112de7868","spec/wasm32_unknown_emscripten.rs":"7fed0ace159340d305800d376087c780871b530a45d9235845ec97c2e6308f7f","spec/wasm32_unknown_unknown.rs":"0645c576bbff47c009e67d56082a655cec90636638e557eefe75decec96cb43f","spec/windows_base.rs":"b16e358fc28099b0dbc8a9f2d7d8af7268e78971bfee41d9b30640d07d9b3f6b","spec/windows_msvc_base.rs":"688b52c4156b02d71b30fa3a839da534e5bfeba579546a57b44aaa2ad3381b7b","spec/x86_64_apple_darwin.rs":"1292b1378047e96ffd6c7f51f782efb783ca1c46d081135c9068d9ae6e78721c","spec/x86_64_apple_ios.rs":"70e39755637fd0ea3474c80c53e25ea8b69723f4ddc6f84c905e3dae96461344","spec/x86_64_fortanix_unknown_sgx.rs":"c6dd1cbfd43328c22600cbfea061a5057d73130f8eac2b61e453b8e489dc68d9","spec/x86_64_fuchsia.rs":"4462d0b9105b5caa196de6278c8b453ac6fcec9aad6f1c8a6bde94aeaceec9dc","spec/x86_64_linux_android.rs":"f6e775d5e402fa8ed781ff9fb8422c6b02240d4616fd0006d9d2b3e3d19f82ab","spec/x86_64_pc_windows_gnu.rs":"32a976aa70e7740e24faa0d5aa78e415bb857b69cbbe77754c693b82ac78d1ac","spec/x86_64_pc_windows_msvc.rs":"6cb7a8f24ed58b6ae22b1eb53b90ec4ab642eb44b5c6882c24d50422771a6982","spec/x86_64_rumprun_netbsd.rs":"9f918b8555f8b817af67d9e8bd9b7c11e8ffa68f82e2b86400072b5ac572ccc8","spec/x86_64_sun_solaris.rs":"e14a2413a87e38ee8427c10f87d14e495c20ad29537cbbaac3dc37a14327fdf5","spec/x86_64_unknown_bitrig.rs":"04935059c54c59477aea0621355b2a1733682db3e342ca4239e763261195505a","spec/x86_64_unknown_cloudabi.rs":"9d0e1375b26436cc0262f968662de6347dc5de12b3dc97efd88a66d0e7ece81d","spec/x86_64_unknown_dragonfly.rs":"5a09568866f457df2c4884d6a3bc7117b437c5fff84cc0060d8fa1a20a685320","spec/x86_64_unknown_freebsd.rs":"98888eee7d57d685a3bac4cf0fcc91a4dbacef56e6db12998c75287b79d8e235","spec/x86_64_unknown_haiku.rs":"9cc21936a51f7f93417b47f8ed625b0e706a4c409b6f0e6b86cf936cabd35805","spec/x86_64_unknown_hermit.rs":"76493ebbd2c1d4f4faad5dcc055ed605c34f29b22f41eb6f7e5534b37e8c1547","spec/x86_64_unknown_l4re_uclibc.rs":"6b376b83de97eda3ba12bd60e3160eedab67bc79c74e5222ad85e88236a965cb","spec/x86_64_unknown_linux_gnu.rs":"c7edd3d9d3ebbd9184aec5e2c9c809f15ddb283c4a8388923f1e8e02e72e0b83","spec/x86_64_unknown_linux_gnux32.rs":"540e06ef359fed34970fa529c4816c09fe9467f25f4f9fc73b945b8c63ab314c","spec/x86_64_unknown_linux_musl.rs":"9bd97cf947c9687231472820f2fc6299a798c1a7f96635da960a568b64a9d121","spec/x86_64_unknown_netbsd.rs":"b424e3ef521492ea0d74be45cbaed6f5b7f7c64f7641e5f12b1592c43fff70c4","spec/x86_64_unknown_openbsd.rs":"58996625fe81c81bd559e3b3f7267139ba77c1069b08bbd96ddc483f90637471","spec/x86_64_unknown_redox.rs":"ecdf5dd3d93a4272094a3737dfaf8e1b78d4d0bb047bc50c8b76edd3a5832d85","spec/x86_64_unknown_uefi.rs":"3f9325ec61bad4879b8b1cb156662e27bcff339be046908dda641bcce3ea5402"},"package":"e6de75caef2c7acba11994614266d60238653657677934817ab368d169333cba"}
\ No newline at end of file
diff --git a/vendor/rustc-ap-rustc_target/Cargo.toml b/vendor/rustc-ap-rustc_target/Cargo.toml
new file mode 100644
index 0000000..b31d43e
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/Cargo.toml
@@ -0,0 +1,38 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies
+#
+# If you believe there's an error in this file please file an
+# issue against the rust-lang/cargo repository. If you're
+# editing this file be aware that the upstream Cargo.toml
+# will likely look very different (and much more reasonable)
+
+[package]
+edition = "2018"
+name = "rustc-ap-rustc_target"
+version = "407.0.0"
+authors = ["The Rust Project Developers"]
+description = "Automatically published version of the package `rustc_target` in the rust-lang/rust repository from commit aa97448caf49ee25271a5ad58482283404b9144f The publishing script for this crate lives at: https://github.com/alexcrichton/rustc-auto-publish\n "
+license = "MIT / Apache-2.0"
+repository = "https://github.com/rust-lang/rust"
+
+[lib]
+name = "rustc_target"
+path = "lib.rs"
+[dependencies.bitflags]
+version = "1.0"
+
+[dependencies.log]
+version = "0.4"
+
+[dependencies.rustc-ap-rustc_cratesio_shim]
+version = "407.0.0"
+
+[dependencies.rustc-ap-rustc_data_structures]
+version = "407.0.0"
+
+[dependencies.rustc-ap-serialize]
+version = "407.0.0"
diff --git a/vendor/rustc-ap-rustc_target/README.md b/vendor/rustc-ap-rustc_target/README.md
new file mode 100644
index 0000000..a22000e
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/README.md
@@ -0,0 +1,6 @@
+`librustc_target` contains some very low-level details that are
+specific to different compilation targets and so forth.
+
+For more information about how rustc works, see the [rustc guide].
+
+[rustc guide]: https://rust-lang.github.io/rustc-guide/
diff --git a/vendor/rustc-ap-rustc_target/abi/call/aarch64.rs b/vendor/rustc-ap-rustc_target/abi/call/aarch64.rs
new file mode 100644
index 0000000..f50ec6c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/aarch64.rs
@@ -0,0 +1,114 @@
+use crate::abi::call::{FnType, ArgType, Reg, RegKind, Uniform};
+use crate::abi::{HasDataLayout, LayoutOf, TyLayout, TyLayoutMethods};
+
+fn is_homogeneous_aggregate<'a, Ty, C>(cx: &C, arg: &mut ArgType<'a, Ty>)
+ -> Option<Uniform>
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ arg.layout.homogeneous_aggregate(cx).unit().and_then(|unit| {
+ let size = arg.layout.size;
+
+ // Ensure we have at most four uniquely addressable members.
+ if size > unit.size.checked_mul(4, cx).unwrap() {
+ return None;
+ }
+
+ let valid_unit = match unit.kind {
+ RegKind::Integer => false,
+ RegKind::Float => true,
+ RegKind::Vector => size.bits() == 64 || size.bits() == 128
+ };
+
+ if valid_unit {
+ Some(Uniform {
+ unit,
+ total: size
+ })
+ } else {
+ None
+ }
+ })
+}
+
+fn classify_ret_ty<'a, Ty, C>(cx: &C, ret: &mut ArgType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !ret.layout.is_aggregate() {
+ ret.extend_integer_width_to(32);
+ return;
+ }
+ if let Some(uniform) = is_homogeneous_aggregate(cx, ret) {
+ ret.cast_to(uniform);
+ return;
+ }
+ let size = ret.layout.size;
+ let bits = size.bits();
+ if bits <= 128 {
+ let unit = if bits <= 8 {
+ Reg::i8()
+ } else if bits <= 16 {
+ Reg::i16()
+ } else if bits <= 32 {
+ Reg::i32()
+ } else {
+ Reg::i64()
+ };
+
+ ret.cast_to(Uniform {
+ unit,
+ total: size
+ });
+ return;
+ }
+ ret.make_indirect();
+}
+
+fn classify_arg_ty<'a, Ty, C>(cx: &C, arg: &mut ArgType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !arg.layout.is_aggregate() {
+ arg.extend_integer_width_to(32);
+ return;
+ }
+ if let Some(uniform) = is_homogeneous_aggregate(cx, arg) {
+ arg.cast_to(uniform);
+ return;
+ }
+ let size = arg.layout.size;
+ let bits = size.bits();
+ if bits <= 128 {
+ let unit = if bits <= 8 {
+ Reg::i8()
+ } else if bits <= 16 {
+ Reg::i16()
+ } else if bits <= 32 {
+ Reg::i32()
+ } else {
+ Reg::i64()
+ };
+
+ arg.cast_to(Uniform {
+ unit,
+ total: size
+ });
+ return;
+ }
+ arg.make_indirect();
+}
+
+pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(cx, &mut fty.ret);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ classify_arg_ty(cx, arg);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/amdgpu.rs b/vendor/rustc-ap-rustc_target/abi/call/amdgpu.rs
new file mode 100644
index 0000000..6bfd1f4
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/amdgpu.rs
@@ -0,0 +1,32 @@
+use crate::abi::call::{ArgType, FnType, };
+use crate::abi::{HasDataLayout, LayoutOf, TyLayout, TyLayoutMethods};
+
+fn classify_ret_ty<'a, Ty, C>(_cx: &C, ret: &mut ArgType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ ret.extend_integer_width_to(32);
+}
+
+fn classify_arg_ty<'a, Ty, C>(_cx: &C, arg: &mut ArgType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ arg.extend_integer_width_to(32);
+}
+
+pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(cx, &mut fty.ret);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() {
+ continue;
+ }
+ classify_arg_ty(cx, arg);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/arm.rs b/vendor/rustc-ap-rustc_target/abi/call/arm.rs
new file mode 100644
index 0000000..e3fee8e
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/arm.rs
@@ -0,0 +1,112 @@
+use crate::abi::call::{Conv, FnType, ArgType, Reg, RegKind, Uniform};
+use crate::abi::{HasDataLayout, LayoutOf, TyLayout, TyLayoutMethods};
+use crate::spec::HasTargetSpec;
+
+fn is_homogeneous_aggregate<'a, Ty, C>(cx: &C, arg: &mut ArgType<'a, Ty>)
+ -> Option<Uniform>
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ arg.layout.homogeneous_aggregate(cx).unit().and_then(|unit| {
+ let size = arg.layout.size;
+
+ // Ensure we have at most four uniquely addressable members.
+ if size > unit.size.checked_mul(4, cx).unwrap() {
+ return None;
+ }
+
+ let valid_unit = match unit.kind {
+ RegKind::Integer => false,
+ RegKind::Float => true,
+ RegKind::Vector => size.bits() == 64 || size.bits() == 128
+ };
+
+ if valid_unit {
+ Some(Uniform {
+ unit,
+ total: size
+ })
+ } else {
+ None
+ }
+ })
+}
+
+fn classify_ret_ty<'a, Ty, C>(cx: &C, ret: &mut ArgType<'a, Ty>, vfp: bool)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !ret.layout.is_aggregate() {
+ ret.extend_integer_width_to(32);
+ return;
+ }
+
+ if vfp {
+ if let Some(uniform) = is_homogeneous_aggregate(cx, ret) {
+ ret.cast_to(uniform);
+ return;
+ }
+ }
+
+ let size = ret.layout.size;
+ let bits = size.bits();
+ if bits <= 32 {
+ let unit = if bits <= 8 {
+ Reg::i8()
+ } else if bits <= 16 {
+ Reg::i16()
+ } else {
+ Reg::i32()
+ };
+ ret.cast_to(Uniform {
+ unit,
+ total: size
+ });
+ return;
+ }
+ ret.make_indirect();
+}
+
+fn classify_arg_ty<'a, Ty, C>(cx: &C, arg: &mut ArgType<'a, Ty>, vfp: bool)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !arg.layout.is_aggregate() {
+ arg.extend_integer_width_to(32);
+ return;
+ }
+
+ if vfp {
+ if let Some(uniform) = is_homogeneous_aggregate(cx, arg) {
+ arg.cast_to(uniform);
+ return;
+ }
+ }
+
+ let align = arg.layout.align.abi.bytes();
+ let total = arg.layout.size;
+ arg.cast_to(Uniform {
+ unit: if align <= 4 { Reg::i32() } else { Reg::i64() },
+ total
+ });
+}
+
+pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec
+{
+ // If this is a target with a hard-float ABI, and the function is not explicitly
+ // `extern "aapcs"`, then we must use the VFP registers for homogeneous aggregates.
+ let vfp = cx.target_spec().llvm_target.ends_with("hf")
+ && fty.conv != Conv::ArmAapcs
+ && !fty.c_variadic;
+
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(cx, &mut fty.ret, vfp);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ classify_arg_ty(cx, arg, vfp);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/asmjs.rs b/vendor/rustc-ap-rustc_target/abi/call/asmjs.rs
new file mode 100644
index 0000000..92c8637
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/asmjs.rs
@@ -0,0 +1,47 @@
+use crate::abi::call::{FnType, ArgType, Uniform};
+use crate::abi::{HasDataLayout, LayoutOf, TyLayout, TyLayoutMethods};
+
+// Data layout: e-p:32:32-i64:64-v128:32:128-n32-S128
+
+// See the https://github.com/kripken/emscripten-fastcomp-clang repository.
+// The class `EmscriptenABIInfo` in `/lib/CodeGen/TargetInfo.cpp` contains the ABI definitions.
+
+fn classify_ret_ty<'a, Ty, C>(cx: &C, ret: &mut ArgType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if ret.layout.is_aggregate() {
+ if let Some(unit) = ret.layout.homogeneous_aggregate(cx).unit() {
+ let size = ret.layout.size;
+ if unit.size == size {
+ ret.cast_to(Uniform {
+ unit,
+ total: size
+ });
+ return;
+ }
+ }
+
+ ret.make_indirect();
+ }
+}
+
+fn classify_arg_ty<Ty>(arg: &mut ArgType<'_, Ty>) {
+ if arg.layout.is_aggregate() {
+ arg.make_indirect_byval();
+ }
+}
+
+pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(cx, &mut fty.ret);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ classify_arg_ty(arg);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/hexagon.rs b/vendor/rustc-ap-rustc_target/abi/call/hexagon.rs
new file mode 100644
index 0000000..db8c915
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/hexagon.rs
@@ -0,0 +1,32 @@
+#![allow(non_upper_case_globals)]
+
+use crate::abi::call::{FnType, ArgType};
+
+fn classify_ret_ty<Ty>(ret: &mut ArgType<'_, Ty>) {
+ if ret.layout.is_aggregate() && ret.layout.size.bits() > 64 {
+ ret.make_indirect();
+ } else {
+ ret.extend_integer_width_to(32);
+ }
+}
+
+fn classify_arg_ty<Ty>(arg: &mut ArgType<'_, Ty>) {
+ if arg.layout.is_aggregate() && arg.layout.size.bits() > 64 {
+ arg.make_indirect();
+ } else {
+ arg.extend_integer_width_to(32);
+ }
+}
+
+pub fn compute_abi_info<Ty>(fty: &mut FnType<'_,Ty>) {
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(&mut fty.ret);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() {
+ continue;
+ }
+ classify_arg_ty(arg);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/mips.rs b/vendor/rustc-ap-rustc_target/abi/call/mips.rs
new file mode 100644
index 0000000..d496abf
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/mips.rs
@@ -0,0 +1,49 @@
+use crate::abi::call::{ArgType, FnType, Reg, Uniform};
+use crate::abi::{HasDataLayout, LayoutOf, Size, TyLayoutMethods};
+
+fn classify_ret_ty<'a, Ty, C>(cx: &C, ret: &mut ArgType<'_, Ty>, offset: &mut Size)
+ where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> + HasDataLayout
+{
+ if !ret.layout.is_aggregate() {
+ ret.extend_integer_width_to(32);
+ } else {
+ ret.make_indirect();
+ *offset += cx.data_layout().pointer_size;
+ }
+}
+
+fn classify_arg_ty<'a, Ty, C>(cx: &C, arg: &mut ArgType<'_, Ty>, offset: &mut Size)
+ where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> + HasDataLayout
+{
+ let dl = cx.data_layout();
+ let size = arg.layout.size;
+ let align = arg.layout.align.max(dl.i32_align).min(dl.i64_align).abi;
+
+ if arg.layout.is_aggregate() {
+ arg.cast_to(Uniform {
+ unit: Reg::i32(),
+ total: size
+ });
+ if !offset.is_aligned(align) {
+ arg.pad_with(Reg::i32());
+ }
+ } else {
+ arg.extend_integer_width_to(32);
+ }
+
+ *offset = offset.align_to(align) + size.align_to(align);
+}
+
+pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'_, Ty>)
+ where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> + HasDataLayout
+{
+ let mut offset = Size::ZERO;
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(cx, &mut fty.ret, &mut offset);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ classify_arg_ty(cx, arg, &mut offset);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/mips64.rs b/vendor/rustc-ap-rustc_target/abi/call/mips64.rs
new file mode 100644
index 0000000..5ba05c6
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/mips64.rs
@@ -0,0 +1,156 @@
+use crate::abi::call::{ArgAttribute, ArgType, CastTarget, FnType, PassMode, Reg, RegKind, Uniform};
+use crate::abi::{self, HasDataLayout, LayoutOf, Size, TyLayout, TyLayoutMethods};
+
+fn extend_integer_width_mips<Ty>(arg: &mut ArgType<'_, Ty>, bits: u64) {
+ // Always sign extend u32 values on 64-bit mips
+ if let abi::Abi::Scalar(ref scalar) = arg.layout.abi {
+ if let abi::Int(i, signed) = scalar.value {
+ if !signed && i.size().bits() == 32 {
+ if let PassMode::Direct(ref mut attrs) = arg.mode {
+ attrs.set(ArgAttribute::SExt);
+ return;
+ }
+ }
+ }
+ }
+
+ arg.extend_integer_width_to(bits);
+}
+
+fn float_reg<'a, Ty, C>(cx: &C, ret: &ArgType<'a, Ty>, i: usize) -> Option<Reg>
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ match ret.layout.field(cx, i).abi {
+ abi::Abi::Scalar(ref scalar) => match scalar.value {
+ abi::Float(abi::FloatTy::F32) => Some(Reg::f32()),
+ abi::Float(abi::FloatTy::F64) => Some(Reg::f64()),
+ _ => None
+ },
+ _ => None
+ }
+}
+
+fn classify_ret_ty<'a, Ty, C>(cx: &C, ret: &mut ArgType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !ret.layout.is_aggregate() {
+ extend_integer_width_mips(ret, 64);
+ return;
+ }
+
+ let size = ret.layout.size;
+ let bits = size.bits();
+ if bits <= 128 {
+ // Unlike other architectures which return aggregates in registers, MIPS n64 limits the
+ // use of float registers to structures (not unions) containing exactly one or two
+ // float fields.
+
+ if let abi::FieldPlacement::Arbitrary { .. } = ret.layout.fields {
+ if ret.layout.fields.count() == 1 {
+ if let Some(reg) = float_reg(cx, ret, 0) {
+ ret.cast_to(reg);
+ return;
+ }
+ } else if ret.layout.fields.count() == 2 {
+ if let Some(reg0) = float_reg(cx, ret, 0) {
+ if let Some(reg1) = float_reg(cx, ret, 1) {
+ ret.cast_to(CastTarget::pair(reg0, reg1));
+ return;
+ }
+ }
+ }
+ }
+
+ // Cast to a uniform int structure
+ ret.cast_to(Uniform {
+ unit: Reg::i64(),
+ total: size
+ });
+ } else {
+ ret.make_indirect();
+ }
+}
+
+fn classify_arg_ty<'a, Ty, C>(cx: &C, arg: &mut ArgType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !arg.layout.is_aggregate() {
+ extend_integer_width_mips(arg, 64);
+ return;
+ }
+
+ let dl = cx.data_layout();
+ let size = arg.layout.size;
+ let mut prefix = [None; 8];
+ let mut prefix_index = 0;
+
+ match arg.layout.fields {
+ abi::FieldPlacement::Array { .. } => {
+ // Arrays are passed indirectly
+ arg.make_indirect();
+ return;
+ }
+ abi::FieldPlacement::Union(_) => {
+ // Unions and are always treated as a series of 64-bit integer chunks
+ },
+ abi::FieldPlacement::Arbitrary { .. } => {
+ // Structures are split up into a series of 64-bit integer chunks, but any aligned
+ // doubles not part of another aggregate are passed as floats.
+ let mut last_offset = Size::ZERO;
+
+ for i in 0..arg.layout.fields.count() {
+ let field = arg.layout.field(cx, i);
+ let offset = arg.layout.fields.offset(i);
+
+ // We only care about aligned doubles
+ if let abi::Abi::Scalar(ref scalar) = field.abi {
+ if let abi::Float(abi::FloatTy::F64) = scalar.value {
+ if offset.is_aligned(dl.f64_align.abi) {
+ // Insert enough integers to cover [last_offset, offset)
+ assert!(last_offset.is_aligned(dl.f64_align.abi));
+ for _ in 0..((offset - last_offset).bits() / 64)
+ .min((prefix.len() - prefix_index) as u64) {
+
+ prefix[prefix_index] = Some(RegKind::Integer);
+ prefix_index += 1;
+ }
+
+ if prefix_index == prefix.len() {
+ break;
+ }
+
+ prefix[prefix_index] = Some(RegKind::Float);
+ prefix_index += 1;
+ last_offset = offset + Reg::f64().size;
+ }
+ }
+ }
+ }
+ }
+ };
+
+ // Extract first 8 chunks as the prefix
+ let rest_size = size - Size::from_bytes(8) * prefix_index as u64;
+ arg.cast_to(CastTarget {
+ prefix,
+ prefix_chunk: Size::from_bytes(8),
+ rest: Uniform { unit: Reg::i64(), total: rest_size }
+ });
+}
+
+pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(cx, &mut fty.ret);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ classify_arg_ty(cx, arg);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/mod.rs b/vendor/rustc-ap-rustc_target/abi/call/mod.rs
new file mode 100644
index 0000000..fbbd120
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/mod.rs
@@ -0,0 +1,593 @@
+use crate::abi::{self, Abi, Align, FieldPlacement, Size};
+use crate::abi::{HasDataLayout, LayoutOf, TyLayout, TyLayoutMethods};
+use crate::spec::{self, HasTargetSpec};
+
+mod aarch64;
+mod amdgpu;
+mod arm;
+mod asmjs;
+mod hexagon;
+mod mips;
+mod mips64;
+mod msp430;
+mod nvptx;
+mod nvptx64;
+mod powerpc;
+mod powerpc64;
+mod riscv;
+mod s390x;
+mod sparc;
+mod sparc64;
+mod x86;
+mod x86_64;
+mod x86_win64;
+mod wasm32;
+
+#[derive(Clone, Copy, PartialEq, Eq, Debug)]
+pub enum IgnoreMode {
+ /// C-variadic arguments.
+ CVarArgs,
+ /// A zero-sized type.
+ Zst,
+}
+
+#[derive(Clone, Copy, PartialEq, Eq, Debug)]
+pub enum PassMode {
+ /// Ignore the argument (useful for empty structs and C-variadic args).
+ Ignore(IgnoreMode),
+ /// Pass the argument directly.
+ Direct(ArgAttributes),
+ /// Pass a pair's elements directly in two arguments.
+ Pair(ArgAttributes, ArgAttributes),
+ /// Pass the argument after casting it, to either
+ /// a single uniform or a pair of registers.
+ Cast(CastTarget),
+ /// Pass the argument indirectly via a hidden pointer.
+ /// The second value, if any, is for the extra data (vtable or length)
+ /// which indicates that it refers to an unsized rvalue.
+ Indirect(ArgAttributes, Option<ArgAttributes>),
+}
+
+// Hack to disable non_upper_case_globals only for the bitflags! and not for the rest
+// of this module
+pub use attr_impl::ArgAttribute;
+
+#[allow(non_upper_case_globals)]
+#[allow(unused)]
+mod attr_impl {
+ // The subset of llvm::Attribute needed for arguments, packed into a bitfield.
+ bitflags::bitflags! {
+ #[derive(Default)]
+ pub struct ArgAttribute: u16 {
+ const ByVal = 1 << 0;
+ const NoAlias = 1 << 1;
+ const NoCapture = 1 << 2;
+ const NonNull = 1 << 3;
+ const ReadOnly = 1 << 4;
+ const SExt = 1 << 5;
+ const StructRet = 1 << 6;
+ const ZExt = 1 << 7;
+ const InReg = 1 << 8;
+ }
+ }
+}
+
+/// A compact representation of LLVM attributes (at least those relevant for this module)
+/// that can be manipulated without interacting with LLVM's Attribute machinery.
+#[derive(Copy, Clone, PartialEq, Eq, Debug)]
+pub struct ArgAttributes {
+ pub regular: ArgAttribute,
+ pub pointee_size: Size,
+ pub pointee_align: Option<Align>
+}
+
+impl ArgAttributes {
+ pub fn new() -> Self {
+ ArgAttributes {
+ regular: ArgAttribute::default(),
+ pointee_size: Size::ZERO,
+ pointee_align: None,
+ }
+ }
+
+ pub fn set(&mut self, attr: ArgAttribute) -> &mut Self {
+ self.regular |= attr;
+ self
+ }
+
+ pub fn contains(&self, attr: ArgAttribute) -> bool {
+ self.regular.contains(attr)
+ }
+}
+
+#[derive(Copy, Clone, PartialEq, Eq, Debug)]
+pub enum RegKind {
+ Integer,
+ Float,
+ Vector
+}
+
+#[derive(Copy, Clone, PartialEq, Eq, Debug)]
+pub struct Reg {
+ pub kind: RegKind,
+ pub size: Size,
+}
+
+macro_rules! reg_ctor {
+ ($name:ident, $kind:ident, $bits:expr) => {
+ pub fn $name() -> Reg {
+ Reg {
+ kind: RegKind::$kind,
+ size: Size::from_bits($bits)
+ }
+ }
+ }
+}
+
+impl Reg {
+ reg_ctor!(i8, Integer, 8);
+ reg_ctor!(i16, Integer, 16);
+ reg_ctor!(i32, Integer, 32);
+ reg_ctor!(i64, Integer, 64);
+
+ reg_ctor!(f32, Float, 32);
+ reg_ctor!(f64, Float, 64);
+}
+
+impl Reg {
+ pub fn align<C: HasDataLayout>(&self, cx: &C) -> Align {
+ let dl = cx.data_layout();
+ match self.kind {
+ RegKind::Integer => {
+ match self.size.bits() {
+ 1 => dl.i1_align.abi,
+ 2..=8 => dl.i8_align.abi,
+ 9..=16 => dl.i16_align.abi,
+ 17..=32 => dl.i32_align.abi,
+ 33..=64 => dl.i64_align.abi,
+ 65..=128 => dl.i128_align.abi,
+ _ => panic!("unsupported integer: {:?}", self)
+ }
+ }
+ RegKind::Float => {
+ match self.size.bits() {
+ 32 => dl.f32_align.abi,
+ 64 => dl.f64_align.abi,
+ _ => panic!("unsupported float: {:?}", self)
+ }
+ }
+ RegKind::Vector => dl.vector_align(self.size).abi,
+ }
+ }
+}
+
+/// An argument passed entirely registers with the
+/// same kind (e.g., HFA / HVA on PPC64 and AArch64).
+#[derive(Clone, Copy, PartialEq, Eq, Debug)]
+pub struct Uniform {
+ pub unit: Reg,
+
+ /// The total size of the argument, which can be:
+ /// * equal to `unit.size` (one scalar/vector),
+ /// * a multiple of `unit.size` (an array of scalar/vectors),
+ /// * if `unit.kind` is `Integer`, the last element
+ /// can be shorter, i.e., `{ i64, i64, i32 }` for
+ /// 64-bit integers with a total size of 20 bytes.
+ pub total: Size,
+}
+
+impl From<Reg> for Uniform {
+ fn from(unit: Reg) -> Uniform {
+ Uniform {
+ unit,
+ total: unit.size
+ }
+ }
+}
+
+impl Uniform {
+ pub fn align<C: HasDataLayout>(&self, cx: &C) -> Align {
+ self.unit.align(cx)
+ }
+}
+
+#[derive(Clone, Copy, PartialEq, Eq, Debug)]
+pub struct CastTarget {
+ pub prefix: [Option<RegKind>; 8],
+ pub prefix_chunk: Size,
+ pub rest: Uniform,
+}
+
+impl From<Reg> for CastTarget {
+ fn from(unit: Reg) -> CastTarget {
+ CastTarget::from(Uniform::from(unit))
+ }
+}
+
+impl From<Uniform> for CastTarget {
+ fn from(uniform: Uniform) -> CastTarget {
+ CastTarget {
+ prefix: [None; 8],
+ prefix_chunk: Size::ZERO,
+ rest: uniform
+ }
+ }
+}
+
+impl CastTarget {
+ pub fn pair(a: Reg, b: Reg) -> CastTarget {
+ CastTarget {
+ prefix: [Some(a.kind), None, None, None, None, None, None, None],
+ prefix_chunk: a.size,
+ rest: Uniform::from(b)
+ }
+ }
+
+ pub fn size<C: HasDataLayout>(&self, cx: &C) -> Size {
+ (self.prefix_chunk * self.prefix.iter().filter(|x| x.is_some()).count() as u64)
+ .align_to(self.rest.align(cx)) + self.rest.total
+ }
+
+ pub fn align<C: HasDataLayout>(&self, cx: &C) -> Align {
+ self.prefix.iter()
+ .filter_map(|x| x.map(|kind| Reg { kind, size: self.prefix_chunk }.align(cx)))
+ .fold(cx.data_layout().aggregate_align.abi.max(self.rest.align(cx)),
+ |acc, align| acc.max(align))
+ }
+}
+
+/// Returns value from the `homogeneous_aggregate` test function.
+#[derive(Copy, Clone, Debug)]
+pub enum HomogeneousAggregate {
+ /// Yes, all the "leaf fields" of this struct are passed in the
+ /// same way (specified in the `Reg` value).
+ Homogeneous(Reg),
+
+ /// There are distinct leaf fields passed in different ways,
+ /// or this is uninhabited.
+ Heterogeneous,
+
+ /// There are no leaf fields at all.
+ NoData,
+}
+
+impl HomogeneousAggregate {
+ /// If this is a homogeneous aggregate, returns the homogeneous
+ /// unit, else `None`.
+ pub fn unit(self) -> Option<Reg> {
+ if let HomogeneousAggregate::Homogeneous(r) = self {
+ Some(r)
+ } else {
+ None
+ }
+ }
+}
+
+impl<'a, Ty> TyLayout<'a, Ty> {
+ fn is_aggregate(&self) -> bool {
+ match self.abi {
+ Abi::Uninhabited |
+ Abi::Scalar(_) |
+ Abi::Vector { .. } => false,
+ Abi::ScalarPair(..) |
+ Abi::Aggregate { .. } => true
+ }
+ }
+
+ /// Returns `true` if this layout is an aggregate containing fields of only
+ /// a single type (e.g., `(u32, u32)`). Such aggregates are often
+ /// special-cased in ABIs.
+ ///
+ /// Note: We generally ignore fields of zero-sized type when computing
+ /// this value (see #56877).
+ ///
+ /// This is public so that it can be used in unit tests, but
+ /// should generally only be relevant to the ABI details of
+ /// specific targets.
+ pub fn homogeneous_aggregate<C>(&self, cx: &C) -> HomogeneousAggregate
+ where Ty: TyLayoutMethods<'a, C> + Copy, C: LayoutOf<Ty = Ty, TyLayout = Self>
+ {
+ match self.abi {
+ Abi::Uninhabited => HomogeneousAggregate::Heterogeneous,
+
+ // The primitive for this algorithm.
+ Abi::Scalar(ref scalar) => {
+ let kind = match scalar.value {
+ abi::Int(..) |
+ abi::Pointer => RegKind::Integer,
+ abi::Float(_) => RegKind::Float,
+ };
+ HomogeneousAggregate::Homogeneous(Reg {
+ kind,
+ size: self.size
+ })
+ }
+
+ Abi::Vector { .. } => {
+ assert!(!self.is_zst());
+ HomogeneousAggregate::Homogeneous(Reg {
+ kind: RegKind::Vector,
+ size: self.size
+ })
+ }
+
+ Abi::ScalarPair(..) |
+ Abi::Aggregate { .. } => {
+ let mut total = Size::ZERO;
+ let mut result = None;
+
+ let is_union = match self.fields {
+ FieldPlacement::Array { count, .. } => {
+ if count > 0 {
+ return self.field(cx, 0).homogeneous_aggregate(cx);
+ } else {
+ return HomogeneousAggregate::NoData;
+ }
+ }
+ FieldPlacement::Union(_) => true,
+ FieldPlacement::Arbitrary { .. } => false
+ };
+
+ for i in 0..self.fields.count() {
+ if !is_union && total != self.fields.offset(i) {
+ return HomogeneousAggregate::Heterogeneous;
+ }
+
+ let field = self.field(cx, i);
+
+ match (result, field.homogeneous_aggregate(cx)) {
+ (_, HomogeneousAggregate::NoData) => {
+ // Ignore fields that have no data
+ }
+ (_, HomogeneousAggregate::Heterogeneous) => {
+ // The field itself must be a homogeneous aggregate.
+ return HomogeneousAggregate::Heterogeneous;
+ }
+ // If this is the first field, record the unit.
+ (None, HomogeneousAggregate::Homogeneous(unit)) => {
+ result = Some(unit);
+ }
+ // For all following fields, the unit must be the same.
+ (Some(prev_unit), HomogeneousAggregate::Homogeneous(unit)) => {
+ if prev_unit != unit {
+ return HomogeneousAggregate::Heterogeneous;
+ }
+ }
+ }
+
+ // Keep track of the offset (without padding).
+ let size = field.size;
+ if is_union {
+ total = total.max(size);
+ } else {
+ total += size;
+ }
+ }
+
+ // There needs to be no padding.
+ if total != self.size {
+ HomogeneousAggregate::Heterogeneous
+ } else {
+ match result {
+ Some(reg) => {
+ assert_ne!(total, Size::ZERO);
+ HomogeneousAggregate::Homogeneous(reg)
+ }
+ None => {
+ assert_eq!(total, Size::ZERO);
+ HomogeneousAggregate::NoData
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+/// Information about how to pass an argument to,
+/// or return a value from, a function, under some ABI.
+#[derive(Debug)]
+pub struct ArgType<'a, Ty> {
+ pub layout: TyLayout<'a, Ty>,
+
+ /// Dummy argument, which is emitted before the real argument.
+ pub pad: Option<Reg>,
+
+ pub mode: PassMode,
+}
+
+impl<'a, Ty> ArgType<'a, Ty> {
+ pub fn new(layout: TyLayout<'a, Ty>) -> Self {
+ ArgType {
+ layout,
+ pad: None,
+ mode: PassMode::Direct(ArgAttributes::new()),
+ }
+ }
+
+ pub fn make_indirect(&mut self) {
+ assert_eq!(self.mode, PassMode::Direct(ArgAttributes::new()));
+
+ // Start with fresh attributes for the pointer.
+ let mut attrs = ArgAttributes::new();
+
+ // For non-immediate arguments the callee gets its own copy of
+ // the value on the stack, so there are no aliases. It's also
+ // program-invisible so can't possibly capture
+ attrs.set(ArgAttribute::NoAlias)
+ .set(ArgAttribute::NoCapture)
+ .set(ArgAttribute::NonNull);
+ attrs.pointee_size = self.layout.size;
+ // FIXME(eddyb) We should be doing this, but at least on
+ // i686-pc-windows-msvc, it results in wrong stack offsets.
+ // attrs.pointee_align = Some(self.layout.align.abi);
+
+ let extra_attrs = if self.layout.is_unsized() {
+ Some(ArgAttributes::new())
+ } else {
+ None
+ };
+
+ self.mode = PassMode::Indirect(attrs, extra_attrs);
+ }
+
+ pub fn make_indirect_byval(&mut self) {
+ self.make_indirect();
+ match self.mode {
+ PassMode::Indirect(ref mut attrs, _) => {
+ attrs.set(ArgAttribute::ByVal);
+ }
+ _ => unreachable!()
+ }
+ }
+
+ pub fn extend_integer_width_to(&mut self, bits: u64) {
+ // Only integers have signedness
+ if let Abi::Scalar(ref scalar) = self.layout.abi {
+ if let abi::Int(i, signed) = scalar.value {
+ if i.size().bits() < bits {
+ if let PassMode::Direct(ref mut attrs) = self.mode {
+ attrs.set(if signed {
+ ArgAttribute::SExt
+ } else {
+ ArgAttribute::ZExt
+ });
+ }
+ }
+ }
+ }
+ }
+
+ pub fn cast_to<T: Into<CastTarget>>(&mut self, target: T) {
+ assert_eq!(self.mode, PassMode::Direct(ArgAttributes::new()));
+ self.mode = PassMode::Cast(target.into());
+ }
+
+ pub fn pad_with(&mut self, reg: Reg) {
+ self.pad = Some(reg);
+ }
+
+ pub fn is_indirect(&self) -> bool {
+ match self.mode {
+ PassMode::Indirect(..) => true,
+ _ => false
+ }
+ }
+
+ pub fn is_sized_indirect(&self) -> bool {
+ match self.mode {
+ PassMode::Indirect(_, None) => true,
+ _ => false
+ }
+ }
+
+ pub fn is_unsized_indirect(&self) -> bool {
+ match self.mode {
+ PassMode::Indirect(_, Some(_)) => true,
+ _ => false
+ }
+ }
+
+ pub fn is_ignore(&self) -> bool {
+ match self.mode {
+ PassMode::Ignore(_) => true,
+ _ => false
+ }
+ }
+}
+
+#[derive(Copy, Clone, PartialEq, Debug)]
+pub enum Conv {
+ C,
+
+ ArmAapcs,
+
+ Msp430Intr,
+
+ PtxKernel,
+
+ X86Fastcall,
+ X86Intr,
+ X86Stdcall,
+ X86ThisCall,
+ X86VectorCall,
+
+ X86_64SysV,
+ X86_64Win64,
+
+ AmdGpuKernel,
+}
+
+/// Metadata describing how the arguments to a native function
+/// should be passed in order to respect the native ABI.
+///
+/// I will do my best to describe this structure, but these
+/// comments are reverse-engineered and may be inaccurate. -NDM
+#[derive(Debug)]
+pub struct FnType<'a, Ty> {
+ /// The LLVM types of each argument.
+ pub args: Vec<ArgType<'a, Ty>>,
+
+ /// LLVM return type.
+ pub ret: ArgType<'a, Ty>,
+
+ pub c_variadic: bool,
+
+ pub conv: Conv,
+}
+
+impl<'a, Ty> FnType<'a, Ty> {
+ pub fn adjust_for_cabi<C>(&mut self, cx: &C, abi: spec::abi::Abi) -> Result<(), String>
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec
+ {
+ match &cx.target_spec().arch[..] {
+ "x86" => {
+ let flavor = if abi == spec::abi::Abi::Fastcall {
+ x86::Flavor::Fastcall
+ } else {
+ x86::Flavor::General
+ };
+ x86::compute_abi_info(cx, self, flavor);
+ },
+ "x86_64" => if abi == spec::abi::Abi::SysV64 {
+ x86_64::compute_abi_info(cx, self);
+ } else if abi == spec::abi::Abi::Win64 || cx.target_spec().options.is_like_windows {
+ x86_win64::compute_abi_info(self);
+ } else {
+ x86_64::compute_abi_info(cx, self);
+ },
+ "aarch64" => aarch64::compute_abi_info(cx, self),
+ "amdgpu" => amdgpu::compute_abi_info(cx, self),
+ "arm" => arm::compute_abi_info(cx, self),
+ "mips" => mips::compute_abi_info(cx, self),
+ "mips64" => mips64::compute_abi_info(cx, self),
+ "powerpc" => powerpc::compute_abi_info(cx, self),
+ "powerpc64" => powerpc64::compute_abi_info(cx, self),
+ "s390x" => s390x::compute_abi_info(cx, self),
+ "asmjs" => asmjs::compute_abi_info(cx, self),
+ "wasm32" => {
+ if cx.target_spec().llvm_target.contains("emscripten") {
+ asmjs::compute_abi_info(cx, self)
+ } else {
+ wasm32::compute_abi_info(self)
+ }
+ }
+ "msp430" => msp430::compute_abi_info(self),
+ "sparc" => sparc::compute_abi_info(cx, self),
+ "sparc64" => sparc64::compute_abi_info(cx, self),
+ "nvptx" => nvptx::compute_abi_info(self),
+ "nvptx64" => nvptx64::compute_abi_info(self),
+ "hexagon" => hexagon::compute_abi_info(self),
+ "riscv32" => riscv::compute_abi_info(self, 32),
+ "riscv64" => riscv::compute_abi_info(self, 64),
+ a => return Err(format!("unrecognized arch \"{}\" in target specification", a))
+ }
+
+ if let PassMode::Indirect(ref mut attrs, _) = self.ret.mode {
+ attrs.set(ArgAttribute::StructRet);
+ }
+
+ Ok(())
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/msp430.rs b/vendor/rustc-ap-rustc_target/abi/call/msp430.rs
new file mode 100644
index 0000000..7ae1116
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/msp430.rs
@@ -0,0 +1,39 @@
+// Reference: MSP430 Embedded Application Binary Interface
+// http://www.ti.com/lit/an/slaa534/slaa534.pdf
+
+use crate::abi::call::{ArgType, FnType};
+
+// 3.5 Structures or Unions Passed and Returned by Reference
+//
+// "Structures (including classes) and unions larger than 32 bits are passed and
+// returned by reference. To pass a structure or union by reference, the caller
+// places its address in the appropriate location: either in a register or on
+// the stack, according to its position in the argument list. (..)"
+fn classify_ret_ty<Ty>(ret: &mut ArgType<'_, Ty>) {
+ if ret.layout.is_aggregate() && ret.layout.size.bits() > 32 {
+ ret.make_indirect();
+ } else {
+ ret.extend_integer_width_to(16);
+ }
+}
+
+fn classify_arg_ty<Ty>(arg: &mut ArgType<'_, Ty>) {
+ if arg.layout.is_aggregate() && arg.layout.size.bits() > 32 {
+ arg.make_indirect();
+ } else {
+ arg.extend_integer_width_to(16);
+ }
+}
+
+pub fn compute_abi_info<Ty>(fty: &mut FnType<'_, Ty>) {
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(&mut fty.ret);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() {
+ continue;
+ }
+ classify_arg_ty(arg);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/nvptx.rs b/vendor/rustc-ap-rustc_target/abi/call/nvptx.rs
new file mode 100644
index 0000000..4722249
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/nvptx.rs
@@ -0,0 +1,33 @@
+// Reference: PTX Writer's Guide to Interoperability
+// http://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability
+
+use crate::abi::call::{ArgType, FnType};
+
+fn classify_ret_ty<Ty>(ret: &mut ArgType<'_, Ty>) {
+ if ret.layout.is_aggregate() && ret.layout.size.bits() > 32 {
+ ret.make_indirect();
+ } else {
+ ret.extend_integer_width_to(32);
+ }
+}
+
+fn classify_arg_ty<Ty>(arg: &mut ArgType<'_, Ty>) {
+ if arg.layout.is_aggregate() && arg.layout.size.bits() > 32 {
+ arg.make_indirect();
+ } else {
+ arg.extend_integer_width_to(32);
+ }
+}
+
+pub fn compute_abi_info<Ty>(fty: &mut FnType<'_, Ty>) {
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(&mut fty.ret);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() {
+ continue;
+ }
+ classify_arg_ty(arg);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/nvptx64.rs b/vendor/rustc-ap-rustc_target/abi/call/nvptx64.rs
new file mode 100644
index 0000000..51c00ae
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/nvptx64.rs
@@ -0,0 +1,33 @@
+// Reference: PTX Writer's Guide to Interoperability
+// http://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability
+
+use crate::abi::call::{ArgType, FnType};
+
+fn classify_ret_ty<Ty>(ret: &mut ArgType<'_, Ty>) {
+ if ret.layout.is_aggregate() && ret.layout.size.bits() > 64 {
+ ret.make_indirect();
+ } else {
+ ret.extend_integer_width_to(64);
+ }
+}
+
+fn classify_arg_ty<Ty>(arg: &mut ArgType<'_, Ty>) {
+ if arg.layout.is_aggregate() && arg.layout.size.bits() > 64 {
+ arg.make_indirect();
+ } else {
+ arg.extend_integer_width_to(64);
+ }
+}
+
+pub fn compute_abi_info<Ty>(fty: &mut FnType<'_, Ty>) {
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(&mut fty.ret);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() {
+ continue;
+ }
+ classify_arg_ty(arg);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/powerpc.rs b/vendor/rustc-ap-rustc_target/abi/call/powerpc.rs
new file mode 100644
index 0000000..d496abf
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/powerpc.rs
@@ -0,0 +1,49 @@
+use crate::abi::call::{ArgType, FnType, Reg, Uniform};
+use crate::abi::{HasDataLayout, LayoutOf, Size, TyLayoutMethods};
+
+fn classify_ret_ty<'a, Ty, C>(cx: &C, ret: &mut ArgType<'_, Ty>, offset: &mut Size)
+ where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> + HasDataLayout
+{
+ if !ret.layout.is_aggregate() {
+ ret.extend_integer_width_to(32);
+ } else {
+ ret.make_indirect();
+ *offset += cx.data_layout().pointer_size;
+ }
+}
+
+fn classify_arg_ty<'a, Ty, C>(cx: &C, arg: &mut ArgType<'_, Ty>, offset: &mut Size)
+ where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> + HasDataLayout
+{
+ let dl = cx.data_layout();
+ let size = arg.layout.size;
+ let align = arg.layout.align.max(dl.i32_align).min(dl.i64_align).abi;
+
+ if arg.layout.is_aggregate() {
+ arg.cast_to(Uniform {
+ unit: Reg::i32(),
+ total: size
+ });
+ if !offset.is_aligned(align) {
+ arg.pad_with(Reg::i32());
+ }
+ } else {
+ arg.extend_integer_width_to(32);
+ }
+
+ *offset = offset.align_to(align) + size.align_to(align);
+}
+
+pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'_, Ty>)
+ where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> + HasDataLayout
+{
+ let mut offset = Size::ZERO;
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(cx, &mut fty.ret, &mut offset);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ classify_arg_ty(cx, arg, &mut offset);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/powerpc64.rs b/vendor/rustc-ap-rustc_target/abi/call/powerpc64.rs
new file mode 100644
index 0000000..a968310
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/powerpc64.rs
@@ -0,0 +1,144 @@
+// FIXME:
+// Alignment of 128 bit types is not currently handled, this will
+// need to be fixed when PowerPC vector support is added.
+
+use crate::abi::call::{FnType, ArgType, Reg, RegKind, Uniform};
+use crate::abi::{Endian, HasDataLayout, LayoutOf, TyLayout, TyLayoutMethods};
+use crate::spec::HasTargetSpec;
+
+#[derive(Debug, Clone, Copy, PartialEq)]
+enum ABI {
+ ELFv1, // original ABI used for powerpc64 (big-endian)
+ ELFv2, // newer ABI used for powerpc64le and musl (both endians)
+}
+use ABI::*;
+
+fn is_homogeneous_aggregate<'a, Ty, C>(cx: &C, arg: &mut ArgType<'a, Ty>, abi: ABI)
+ -> Option<Uniform>
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ arg.layout.homogeneous_aggregate(cx).unit().and_then(|unit| {
+ // ELFv1 only passes one-member aggregates transparently.
+ // ELFv2 passes up to eight uniquely addressable members.
+ if (abi == ELFv1 && arg.layout.size > unit.size)
+ || arg.layout.size > unit.size.checked_mul(8, cx).unwrap() {
+ return None;
+ }
+
+ let valid_unit = match unit.kind {
+ RegKind::Integer => false,
+ RegKind::Float => true,
+ RegKind::Vector => arg.layout.size.bits() == 128
+ };
+
+ if valid_unit {
+ Some(Uniform {
+ unit,
+ total: arg.layout.size
+ })
+ } else {
+ None
+ }
+ })
+}
+
+fn classify_ret_ty<'a, Ty, C>(cx: &C, ret: &mut ArgType<'a, Ty>, abi: ABI)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !ret.layout.is_aggregate() {
+ ret.extend_integer_width_to(64);
+ return;
+ }
+
+ // The ELFv1 ABI doesn't return aggregates in registers
+ if abi == ELFv1 {
+ ret.make_indirect();
+ return;
+ }
+
+ if let Some(uniform) = is_homogeneous_aggregate(cx, ret, abi) {
+ ret.cast_to(uniform);
+ return;
+ }
+
+ let size = ret.layout.size;
+ let bits = size.bits();
+ if bits <= 128 {
+ let unit = if cx.data_layout().endian == Endian::Big {
+ Reg { kind: RegKind::Integer, size }
+ } else if bits <= 8 {
+ Reg::i8()
+ } else if bits <= 16 {
+ Reg::i16()
+ } else if bits <= 32 {
+ Reg::i32()
+ } else {
+ Reg::i64()
+ };
+
+ ret.cast_to(Uniform {
+ unit,
+ total: size
+ });
+ return;
+ }
+
+ ret.make_indirect();
+}
+
+fn classify_arg_ty<'a, Ty, C>(cx: &C, arg: &mut ArgType<'a, Ty>, abi: ABI)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !arg.layout.is_aggregate() {
+ arg.extend_integer_width_to(64);
+ return;
+ }
+
+ if let Some(uniform) = is_homogeneous_aggregate(cx, arg, abi) {
+ arg.cast_to(uniform);
+ return;
+ }
+
+ let size = arg.layout.size;
+ let (unit, total) = if size.bits() <= 64 {
+ // Aggregates smaller than a doubleword should appear in
+ // the least-significant bits of the parameter doubleword.
+ (Reg { kind: RegKind::Integer, size }, size)
+ } else {
+ // Aggregates larger than a doubleword should be padded
+ // at the tail to fill out a whole number of doublewords.
+ let reg_i64 = Reg::i64();
+ (reg_i64, size.align_to(reg_i64.align(cx)))
+ };
+
+ arg.cast_to(Uniform {
+ unit,
+ total
+ });
+}
+
+pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec
+{
+ let abi = if cx.target_spec().target_env == "musl" {
+ ELFv2
+ } else {
+ match cx.data_layout().endian {
+ Endian::Big => ELFv1,
+ Endian::Little => ELFv2
+ }
+ };
+
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(cx, &mut fty.ret, abi);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ classify_arg_ty(cx, arg, abi);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/riscv.rs b/vendor/rustc-ap-rustc_target/abi/call/riscv.rs
new file mode 100644
index 0000000..ba82e49
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/riscv.rs
@@ -0,0 +1,49 @@
+// Reference: RISC-V ELF psABI specification
+// https://github.com/riscv/riscv-elf-psabi-doc
+
+use crate::abi::call::{ArgType, FnType};
+
+fn classify_ret_ty<Ty>(arg: &mut ArgType<'_, Ty>, xlen: u64) {
+ // "Scalars wider than 2✕XLEN are passed by reference and are replaced in
+ // the argument list with the address."
+ // "Aggregates larger than 2✕XLEN bits are passed by reference and are
+ // replaced in the argument list with the address, as are C++ aggregates
+ // with nontrivial copy constructors, destructors, or vtables."
+ if arg.layout.size.bits() > 2 * xlen {
+ arg.make_indirect();
+ }
+
+ // "When passed in registers, scalars narrower than XLEN bits are widened
+ // according to the sign of their type up to 32 bits, then sign-extended to
+ // XLEN bits."
+ arg.extend_integer_width_to(xlen); // this method only affects integer scalars
+}
+
+fn classify_arg_ty<Ty>(arg: &mut ArgType<'_, Ty>, xlen: u64) {
+ // "Scalars wider than 2✕XLEN are passed by reference and are replaced in
+ // the argument list with the address."
+ // "Aggregates larger than 2✕XLEN bits are passed by reference and are
+ // replaced in the argument list with the address, as are C++ aggregates
+ // with nontrivial copy constructors, destructors, or vtables."
+ if arg.layout.size.bits() > 2 * xlen {
+ arg.make_indirect();
+ }
+
+ // "When passed in registers, scalars narrower than XLEN bits are widened
+ // according to the sign of their type up to 32 bits, then sign-extended to
+ // XLEN bits."
+ arg.extend_integer_width_to(xlen); // this method only affects integer scalars
+}
+
+pub fn compute_abi_info<Ty>(fty: &mut FnType<'_, Ty>, xlen: u64) {
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(&mut fty.ret, xlen);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() {
+ continue;
+ }
+ classify_arg_ty(arg, xlen);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/s390x.rs b/vendor/rustc-ap-rustc_target/abi/call/s390x.rs
new file mode 100644
index 0000000..c2717b1
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/s390x.rs
@@ -0,0 +1,72 @@
+// FIXME: The assumes we're using the non-vector ABI, i.e., compiling
+// for a pre-z13 machine or using -mno-vx.
+
+use crate::abi::call::{FnType, ArgType, Reg};
+use crate::abi::{self, HasDataLayout, LayoutOf, TyLayout, TyLayoutMethods};
+
+fn classify_ret_ty<'a, Ty, C>(ret: &mut ArgType<'_, Ty>)
+ where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> + HasDataLayout
+{
+ if !ret.layout.is_aggregate() && ret.layout.size.bits() <= 64 {
+ ret.extend_integer_width_to(64);
+ } else {
+ ret.make_indirect();
+ }
+}
+
+fn is_single_fp_element<'a, Ty, C>(cx: &C, layout: TyLayout<'a, Ty>) -> bool
+ where Ty: TyLayoutMethods<'a, C>,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ match layout.abi {
+ abi::Abi::Scalar(ref scalar) => scalar.value.is_float(),
+ abi::Abi::Aggregate { .. } => {
+ if layout.fields.count() == 1 && layout.fields.offset(0).bytes() == 0 {
+ is_single_fp_element(cx, layout.field(cx, 0))
+ } else {
+ false
+ }
+ }
+ _ => false
+ }
+}
+
+fn classify_arg_ty<'a, Ty, C>(cx: &C, arg: &mut ArgType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !arg.layout.is_aggregate() && arg.layout.size.bits() <= 64 {
+ arg.extend_integer_width_to(64);
+ return;
+ }
+
+ if is_single_fp_element(cx, arg.layout) {
+ match arg.layout.size.bytes() {
+ 4 => arg.cast_to(Reg::f32()),
+ 8 => arg.cast_to(Reg::f64()),
+ _ => arg.make_indirect()
+ }
+ } else {
+ match arg.layout.size.bytes() {
+ 1 => arg.cast_to(Reg::i8()),
+ 2 => arg.cast_to(Reg::i16()),
+ 4 => arg.cast_to(Reg::i32()),
+ 8 => arg.cast_to(Reg::i64()),
+ _ => arg.make_indirect()
+ }
+ }
+}
+
+pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(&mut fty.ret);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ classify_arg_ty(cx, arg);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/sparc.rs b/vendor/rustc-ap-rustc_target/abi/call/sparc.rs
new file mode 100644
index 0000000..d496abf
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/sparc.rs
@@ -0,0 +1,49 @@
+use crate::abi::call::{ArgType, FnType, Reg, Uniform};
+use crate::abi::{HasDataLayout, LayoutOf, Size, TyLayoutMethods};
+
+fn classify_ret_ty<'a, Ty, C>(cx: &C, ret: &mut ArgType<'_, Ty>, offset: &mut Size)
+ where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> + HasDataLayout
+{
+ if !ret.layout.is_aggregate() {
+ ret.extend_integer_width_to(32);
+ } else {
+ ret.make_indirect();
+ *offset += cx.data_layout().pointer_size;
+ }
+}
+
+fn classify_arg_ty<'a, Ty, C>(cx: &C, arg: &mut ArgType<'_, Ty>, offset: &mut Size)
+ where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> + HasDataLayout
+{
+ let dl = cx.data_layout();
+ let size = arg.layout.size;
+ let align = arg.layout.align.max(dl.i32_align).min(dl.i64_align).abi;
+
+ if arg.layout.is_aggregate() {
+ arg.cast_to(Uniform {
+ unit: Reg::i32(),
+ total: size
+ });
+ if !offset.is_aligned(align) {
+ arg.pad_with(Reg::i32());
+ }
+ } else {
+ arg.extend_integer_width_to(32);
+ }
+
+ *offset = offset.align_to(align) + size.align_to(align);
+}
+
+pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'_, Ty>)
+ where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> + HasDataLayout
+{
+ let mut offset = Size::ZERO;
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(cx, &mut fty.ret, &mut offset);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ classify_arg_ty(cx, arg, &mut offset);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/sparc64.rs b/vendor/rustc-ap-rustc_target/abi/call/sparc64.rs
new file mode 100644
index 0000000..d8930a8
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/sparc64.rs
@@ -0,0 +1,100 @@
+// FIXME: This needs an audit for correctness and completeness.
+
+use crate::abi::call::{FnType, ArgType, Reg, RegKind, Uniform};
+use crate::abi::{HasDataLayout, LayoutOf, TyLayout, TyLayoutMethods};
+
+fn is_homogeneous_aggregate<'a, Ty, C>(cx: &C, arg: &mut ArgType<'a, Ty>)
+ -> Option<Uniform>
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ arg.layout.homogeneous_aggregate(cx).unit().and_then(|unit| {
+ // Ensure we have at most eight uniquely addressable members.
+ if arg.layout.size > unit.size.checked_mul(8, cx).unwrap() {
+ return None;
+ }
+
+ let valid_unit = match unit.kind {
+ RegKind::Integer => false,
+ RegKind::Float => true,
+ RegKind::Vector => arg.layout.size.bits() == 128
+ };
+
+ if valid_unit {
+ Some(Uniform {
+ unit,
+ total: arg.layout.size
+ })
+ } else {
+ None
+ }
+ })
+}
+
+fn classify_ret_ty<'a, Ty, C>(cx: &C, ret: &mut ArgType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !ret.layout.is_aggregate() {
+ ret.extend_integer_width_to(64);
+ return;
+ }
+
+ if let Some(uniform) = is_homogeneous_aggregate(cx, ret) {
+ ret.cast_to(uniform);
+ return;
+ }
+ let size = ret.layout.size;
+ let bits = size.bits();
+ if bits <= 256 {
+ let unit = Reg::i64();
+ ret.cast_to(Uniform {
+ unit,
+ total: size
+ });
+ return;
+ }
+
+ // don't return aggregates in registers
+ ret.make_indirect();
+}
+
+fn classify_arg_ty<'a, Ty, C>(cx: &C, arg: &mut ArgType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !arg.layout.is_aggregate() {
+ arg.extend_integer_width_to(64);
+ return;
+ }
+
+ if let Some(uniform) = is_homogeneous_aggregate(cx, arg) {
+ arg.cast_to(uniform);
+ return;
+ }
+
+ let total = arg.layout.size;
+ if total.bits() > 128 {
+ arg.make_indirect();
+ return;
+ }
+
+ arg.cast_to(Uniform {
+ unit: Reg::i64(),
+ total
+ });
+}
+
+pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(cx, &mut fty.ret);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ classify_arg_ty(cx, arg);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/wasm32.rs b/vendor/rustc-ap-rustc_target/abi/call/wasm32.rs
new file mode 100644
index 0000000..1fdcbb8
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/wasm32.rs
@@ -0,0 +1,20 @@
+use crate::abi::call::{FnType, ArgType};
+
+fn classify_ret_ty<Ty>(ret: &mut ArgType<'_, Ty>) {
+ ret.extend_integer_width_to(32);
+}
+
+fn classify_arg_ty<Ty>(arg: &mut ArgType<'_, Ty>) {
+ arg.extend_integer_width_to(32);
+}
+
+pub fn compute_abi_info<Ty>(fty: &mut FnType<'_, Ty>) {
+ if !fty.ret.is_ignore() {
+ classify_ret_ty(&mut fty.ret);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ classify_arg_ty(arg);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/x86.rs b/vendor/rustc-ap-rustc_target/abi/call/x86.rs
new file mode 100644
index 0000000..6ca3ce8
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/x86.rs
@@ -0,0 +1,129 @@
+use crate::abi::call::{ArgAttribute, FnType, PassMode, Reg, RegKind};
+use crate::abi::{self, HasDataLayout, LayoutOf, TyLayout, TyLayoutMethods};
+use crate::spec::HasTargetSpec;
+
+#[derive(PartialEq)]
+pub enum Flavor {
+ General,
+ Fastcall
+}
+
+fn is_single_fp_element<'a, Ty, C>(cx: &C, layout: TyLayout<'a, Ty>) -> bool
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ match layout.abi {
+ abi::Abi::Scalar(ref scalar) => scalar.value.is_float(),
+ abi::Abi::Aggregate { .. } => {
+ if layout.fields.count() == 1 && layout.fields.offset(0).bytes() == 0 {
+ is_single_fp_element(cx, layout.field(cx, 0))
+ } else {
+ false
+ }
+ }
+ _ => false
+ }
+}
+
+pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'a, Ty>, flavor: Flavor)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout + HasTargetSpec
+{
+ if !fty.ret.is_ignore() {
+ if fty.ret.layout.is_aggregate() {
+ // Returning a structure. Most often, this will use
+ // a hidden first argument. On some platforms, though,
+ // small structs are returned as integers.
+ //
+ // Some links:
+ // http://www.angelcode.com/dev/callconv/callconv.html
+ // Clang's ABI handling is in lib/CodeGen/TargetInfo.cpp
+ let t = cx.target_spec();
+ if t.options.abi_return_struct_as_int {
+ // According to Clang, everyone but MSVC returns single-element
+ // float aggregates directly in a floating-point register.
+ if !t.options.is_like_msvc && is_single_fp_element(cx, fty.ret.layout) {
+ match fty.ret.layout.size.bytes() {
+ 4 => fty.ret.cast_to(Reg::f32()),
+ 8 => fty.ret.cast_to(Reg::f64()),
+ _ => fty.ret.make_indirect()
+ }
+ } else {
+ match fty.ret.layout.size.bytes() {
+ 1 => fty.ret.cast_to(Reg::i8()),
+ 2 => fty.ret.cast_to(Reg::i16()),
+ 4 => fty.ret.cast_to(Reg::i32()),
+ 8 => fty.ret.cast_to(Reg::i64()),
+ _ => fty.ret.make_indirect()
+ }
+ }
+ } else {
+ fty.ret.make_indirect();
+ }
+ } else {
+ fty.ret.extend_integer_width_to(32);
+ }
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ if arg.layout.is_aggregate() {
+ arg.make_indirect_byval();
+ } else {
+ arg.extend_integer_width_to(32);
+ }
+ }
+
+ if flavor == Flavor::Fastcall {
+ // Mark arguments as InReg like clang does it,
+ // so our fastcall is compatible with C/C++ fastcall.
+
+ // Clang reference: lib/CodeGen/TargetInfo.cpp
+ // See X86_32ABIInfo::shouldPrimitiveUseInReg(), X86_32ABIInfo::updateFreeRegs()
+
+ // IsSoftFloatABI is only set to true on ARM platforms,
+ // which in turn can't be x86?
+
+ let mut free_regs = 2;
+
+ for arg in &mut fty.args {
+ let attrs = match arg.mode {
+ PassMode::Ignore(_) |
+ PassMode::Indirect(_, None) => continue,
+ PassMode::Direct(ref mut attrs) => attrs,
+ PassMode::Pair(..) |
+ PassMode::Indirect(_, Some(_)) |
+ PassMode::Cast(_) => {
+ unreachable!("x86 shouldn't be passing arguments by {:?}", arg.mode)
+ }
+ };
+
+ // At this point we know this must be a primitive of sorts.
+ let unit = arg.layout.homogeneous_aggregate(cx).unit().unwrap();
+ assert_eq!(unit.size, arg.layout.size);
+ if unit.kind == RegKind::Float {
+ continue;
+ }
+
+ let size_in_regs = (arg.layout.size.bits() + 31) / 32;
+
+ if size_in_regs == 0 {
+ continue;
+ }
+
+ if size_in_regs > free_regs {
+ break;
+ }
+
+ free_regs -= size_in_regs;
+
+ if arg.layout.size.bits() <= 32 && unit.kind == RegKind::Integer {
+ attrs.set(ArgAttribute::InReg);
+ }
+
+ if free_regs == 0 {
+ break;
+ }
+ }
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/x86_64.rs b/vendor/rustc-ap-rustc_target/abi/call/x86_64.rs
new file mode 100644
index 0000000..680e529
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/x86_64.rs
@@ -0,0 +1,231 @@
+// The classification code for the x86_64 ABI is taken from the clay language
+// https://github.com/jckarter/clay/blob/master/compiler/src/externals.cpp
+
+use crate::abi::call::{ArgType, CastTarget, FnType, Reg, RegKind};
+use crate::abi::{self, Abi, HasDataLayout, LayoutOf, Size, TyLayout, TyLayoutMethods};
+
+/// Classification of "eightbyte" components.
+// N.B., the order of the variants is from general to specific,
+// such that `unify(a, b)` is the "smaller" of `a` and `b`.
+#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
+enum Class {
+ Int,
+ Sse,
+ SseUp
+}
+
+#[derive(Clone, Copy, Debug)]
+struct Memory;
+
+// Currently supported vector size (AVX-512).
+const LARGEST_VECTOR_SIZE: usize = 512;
+const MAX_EIGHTBYTES: usize = LARGEST_VECTOR_SIZE / 64;
+
+fn classify_arg<'a, Ty, C>(cx: &C, arg: &ArgType<'a, Ty>)
+ -> Result<[Option<Class>; MAX_EIGHTBYTES], Memory>
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ fn classify<'a, Ty, C>(cx: &C, layout: TyLayout<'a, Ty>,
+ cls: &mut [Option<Class>], off: Size) -> Result<(), Memory>
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+ {
+ if !off.is_aligned(layout.align.abi) {
+ if !layout.is_zst() {
+ return Err(Memory);
+ }
+ return Ok(());
+ }
+
+ let mut c = match layout.abi {
+ Abi::Uninhabited => return Ok(()),
+
+ Abi::Scalar(ref scalar) => {
+ match scalar.value {
+ abi::Int(..) |
+ abi::Pointer => Class::Int,
+ abi::Float(_) => Class::Sse
+ }
+ }
+
+ Abi::Vector { .. } => Class::Sse,
+
+ Abi::ScalarPair(..) |
+ Abi::Aggregate { .. } => {
+ match layout.variants {
+ abi::Variants::Single { .. } => {
+ for i in 0..layout.fields.count() {
+ let field_off = off + layout.fields.offset(i);
+ classify(cx, layout.field(cx, i), cls, field_off)?;
+ }
+ return Ok(());
+ }
+ abi::Variants::Tagged { .. } |
+ abi::Variants::NicheFilling { .. } => return Err(Memory),
+ }
+ }
+
+ };
+
+ // Fill in `cls` for scalars (Int/Sse) and vectors (Sse).
+ let first = (off.bytes() / 8) as usize;
+ let last = ((off.bytes() + layout.size.bytes() - 1) / 8) as usize;
+ for cls in &mut cls[first..=last] {
+ *cls = Some(cls.map_or(c, |old| old.min(c)));
+
+ // Everything after the first Sse "eightbyte"
+ // component is the upper half of a register.
+ if c == Class::Sse {
+ c = Class::SseUp;
+ }
+ }
+
+ Ok(())
+ }
+
+ let n = ((arg.layout.size.bytes() + 7) / 8) as usize;
+ if n > MAX_EIGHTBYTES {
+ return Err(Memory);
+ }
+
+ let mut cls = [None; MAX_EIGHTBYTES];
+ classify(cx, arg.layout, &mut cls, Size::ZERO)?;
+ if n > 2 {
+ if cls[0] != Some(Class::Sse) {
+ return Err(Memory);
+ }
+ if cls[1..n].iter().any(|&c| c != Some(Class::SseUp)) {
+ return Err(Memory);
+ }
+ } else {
+ let mut i = 0;
+ while i < n {
+ if cls[i] == Some(Class::SseUp) {
+ cls[i] = Some(Class::Sse);
+ } else if cls[i] == Some(Class::Sse) {
+ i += 1;
+ while i != n && cls[i] == Some(Class::SseUp) { i += 1; }
+ } else {
+ i += 1;
+ }
+ }
+ }
+
+ Ok(cls)
+}
+
+fn reg_component(cls: &[Option<Class>], i: &mut usize, size: Size) -> Option<Reg> {
+ if *i >= cls.len() {
+ return None;
+ }
+
+ match cls[*i] {
+ None => None,
+ Some(Class::Int) => {
+ *i += 1;
+ Some(if size.bytes() < 8 {
+ Reg {
+ kind: RegKind::Integer,
+ size
+ }
+ } else {
+ Reg::i64()
+ })
+ }
+ Some(Class::Sse) => {
+ let vec_len = 1 + cls[*i+1..].iter()
+ .take_while(|&&c| c == Some(Class::SseUp))
+ .count();
+ *i += vec_len;
+ Some(if vec_len == 1 {
+ match size.bytes() {
+ 4 => Reg::f32(),
+ _ => Reg::f64()
+ }
+ } else {
+ Reg {
+ kind: RegKind::Vector,
+ size: Size::from_bytes(8) * (vec_len as u64)
+ }
+ })
+ }
+ Some(c) => unreachable!("reg_component: unhandled class {:?}", c)
+ }
+}
+
+fn cast_target(cls: &[Option<Class>], size: Size) -> CastTarget {
+ let mut i = 0;
+ let lo = reg_component(cls, &mut i, size).unwrap();
+ let offset = Size::from_bytes(8) * (i as u64);
+ let mut target = CastTarget::from(lo);
+ if size > offset {
+ if let Some(hi) = reg_component(cls, &mut i, size - offset) {
+ target = CastTarget::pair(lo, hi);
+ }
+ }
+ assert_eq!(reg_component(cls, &mut i, Size::ZERO), None);
+ target
+}
+
+pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut FnType<'a, Ty>)
+ where Ty: TyLayoutMethods<'a, C> + Copy,
+ C: LayoutOf<Ty = Ty, TyLayout = TyLayout<'a, Ty>> + HasDataLayout
+{
+ let mut int_regs = 6; // RDI, RSI, RDX, RCX, R8, R9
+ let mut sse_regs = 8; // XMM0-7
+
+ let mut x86_64_ty = |arg: &mut ArgType<'a, Ty>, is_arg: bool| {
+ let mut cls_or_mem = classify_arg(cx, arg);
+
+ let mut needed_int = 0;
+ let mut needed_sse = 0;
+ if is_arg {
+ if let Ok(cls) = cls_or_mem {
+ for &c in &cls {
+ match c {
+ Some(Class::Int) => needed_int += 1,
+ Some(Class::Sse) => needed_sse += 1,
+ _ => {}
+ }
+ }
+ if arg.layout.is_aggregate() && (int_regs < needed_int || sse_regs < needed_sse) {
+ cls_or_mem = Err(Memory);
+ }
+ }
+ }
+
+ match cls_or_mem {
+ Err(Memory) => {
+ if is_arg {
+ arg.make_indirect_byval();
+ } else {
+ // `sret` parameter thus one less integer register available
+ arg.make_indirect();
+ int_regs -= 1;
+ }
+ }
+ Ok(ref cls) => {
+ // split into sized chunks passed individually
+ int_regs -= needed_int;
+ sse_regs -= needed_sse;
+
+ if arg.layout.is_aggregate() {
+ let size = arg.layout.size;
+ arg.cast_to(cast_target(cls, size))
+ } else {
+ arg.extend_integer_width_to(32);
+ }
+ }
+ }
+ };
+
+ if !fty.ret.is_ignore() {
+ x86_64_ty(&mut fty.ret, false);
+ }
+
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ x86_64_ty(arg, true);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/call/x86_win64.rs b/vendor/rustc-ap-rustc_target/abi/call/x86_win64.rs
new file mode 100644
index 0000000..ebdeb63
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/call/x86_win64.rs
@@ -0,0 +1,41 @@
+use crate::abi::call::{ArgType, FnType, Reg};
+use crate::abi::Abi;
+
+// Win64 ABI: http://msdn.microsoft.com/en-us/library/zthk2dkh.aspx
+
+pub fn compute_abi_info<Ty>(fty: &mut FnType<'_, Ty>) {
+ let fixup = |a: &mut ArgType<'_, Ty>| {
+ match a.layout.abi {
+ Abi::Uninhabited => {}
+ Abi::ScalarPair(..) |
+ Abi::Aggregate { .. } => {
+ match a.layout.size.bits() {
+ 8 => a.cast_to(Reg::i8()),
+ 16 => a.cast_to(Reg::i16()),
+ 32 => a.cast_to(Reg::i32()),
+ 64 => a.cast_to(Reg::i64()),
+ _ => a.make_indirect()
+ }
+ }
+ Abi::Vector { .. } => {
+ // FIXME(eddyb) there should be a size cap here
+ // (probably what clang calls "illegal vectors").
+ }
+ Abi::Scalar(_) => {
+ if a.layout.size.bytes() > 8 {
+ a.make_indirect();
+ } else {
+ a.extend_integer_width_to(32);
+ }
+ }
+ }
+ };
+
+ if !fty.ret.is_ignore() {
+ fixup(&mut fty.ret);
+ }
+ for arg in &mut fty.args {
+ if arg.is_ignore() { continue; }
+ fixup(arg);
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/abi/mod.rs b/vendor/rustc-ap-rustc_target/abi/mod.rs
new file mode 100644
index 0000000..8b96a8c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/abi/mod.rs
@@ -0,0 +1,942 @@
+pub use Integer::*;
+pub use Primitive::*;
+
+use crate::spec::Target;
+
+use std::fmt;
+use std::ops::{Add, Deref, Sub, Mul, AddAssign, Range, RangeInclusive};
+
+use rustc_data_structures::indexed_vec::{Idx, IndexVec};
+
+pub mod call;
+
+/// Parsed [Data layout](http://llvm.org/docs/LangRef.html#data-layout)
+/// for a target, which contains everything needed to compute layouts.
+pub struct TargetDataLayout {
+ pub endian: Endian,
+ pub i1_align: AbiAndPrefAlign,
+ pub i8_align: AbiAndPrefAlign,
+ pub i16_align: AbiAndPrefAlign,
+ pub i32_align: AbiAndPrefAlign,
+ pub i64_align: AbiAndPrefAlign,
+ pub i128_align: AbiAndPrefAlign,
+ pub f32_align: AbiAndPrefAlign,
+ pub f64_align: AbiAndPrefAlign,
+ pub pointer_size: Size,
+ pub pointer_align: AbiAndPrefAlign,
+ pub aggregate_align: AbiAndPrefAlign,
+
+ /// Alignments for vector types.
+ pub vector_align: Vec<(Size, AbiAndPrefAlign)>,
+
+ pub instruction_address_space: u32,
+}
+
+impl Default for TargetDataLayout {
+ /// Creates an instance of `TargetDataLayout`.
+ fn default() -> TargetDataLayout {
+ let align = |bits| Align::from_bits(bits).unwrap();
+ TargetDataLayout {
+ endian: Endian::Big,
+ i1_align: AbiAndPrefAlign::new(align(8)),
+ i8_align: AbiAndPrefAlign::new(align(8)),
+ i16_align: AbiAndPrefAlign::new(align(16)),
+ i32_align: AbiAndPrefAlign::new(align(32)),
+ i64_align: AbiAndPrefAlign { abi: align(32), pref: align(64) },
+ i128_align: AbiAndPrefAlign { abi: align(32), pref: align(64) },
+ f32_align: AbiAndPrefAlign::new(align(32)),
+ f64_align: AbiAndPrefAlign::new(align(64)),
+ pointer_size: Size::from_bits(64),
+ pointer_align: AbiAndPrefAlign::new(align(64)),
+ aggregate_align: AbiAndPrefAlign { abi: align(0), pref: align(64) },
+ vector_align: vec![
+ (Size::from_bits(64), AbiAndPrefAlign::new(align(64))),
+ (Size::from_bits(128), AbiAndPrefAlign::new(align(128))),
+ ],
+ instruction_address_space: 0,
+ }
+ }
+}
+
+impl TargetDataLayout {
+ pub fn parse(target: &Target) -> Result<TargetDataLayout, String> {
+ // Parse an address space index from a string.
+ let parse_address_space = |s: &str, cause: &str| {
+ s.parse::<u32>().map_err(|err| {
+ format!("invalid address space `{}` for `{}` in \"data-layout\": {}",
+ s, cause, err)
+ })
+ };
+
+ // Parse a bit count from a string.
+ let parse_bits = |s: &str, kind: &str, cause: &str| {
+ s.parse::<u64>().map_err(|err| {
+ format!("invalid {} `{}` for `{}` in \"data-layout\": {}",
+ kind, s, cause, err)
+ })
+ };
+
+ // Parse a size string.
+ let size = |s: &str, cause: &str| {
+ parse_bits(s, "size", cause).map(Size::from_bits)
+ };
+
+ // Parse an alignment string.
+ let align = |s: &[&str], cause: &str| {
+ if s.is_empty() {
+ return Err(format!("missing alignment for `{}` in \"data-layout\"", cause));
+ }
+ let align_from_bits = |bits| {
+ Align::from_bits(bits).map_err(|err| {
+ format!("invalid alignment for `{}` in \"data-layout\": {}",
+ cause, err)
+ })
+ };
+ let abi = parse_bits(s[0], "alignment", cause)?;
+ let pref = s.get(1).map_or(Ok(abi), |pref| parse_bits(pref, "alignment", cause))?;
+ Ok(AbiAndPrefAlign {
+ abi: align_from_bits(abi)?,
+ pref: align_from_bits(pref)?,
+ })
+ };
+
+ let mut dl = TargetDataLayout::default();
+ let mut i128_align_src = 64;
+ for spec in target.data_layout.split('-') {
+ match spec.split(':').collect::<Vec<_>>()[..] {
+ ["e"] => dl.endian = Endian::Little,
+ ["E"] => dl.endian = Endian::Big,
+ [p] if p.starts_with("P") => {
+ dl.instruction_address_space = parse_address_space(&p[1..], "P")?
+ }
+ ["a", ref a..] => dl.aggregate_align = align(a, "a")?,
+ ["f32", ref a..] => dl.f32_align = align(a, "f32")?,
+ ["f64", ref a..] => dl.f64_align = align(a, "f64")?,
+ [p @ "p", s, ref a..] | [p @ "p0", s, ref a..] => {
+ dl.pointer_size = size(s, p)?;
+ dl.pointer_align = align(a, p)?;
+ }
+ [s, ref a..] if s.starts_with("i") => {
+ let bits = match s[1..].parse::<u64>() {
+ Ok(bits) => bits,
+ Err(_) => {
+ size(&s[1..], "i")?; // For the user error.
+ continue;
+ }
+ };
+ let a = align(a, s)?;
+ match bits {
+ 1 => dl.i1_align = a,
+ 8 => dl.i8_align = a,
+ 16 => dl.i16_align = a,
+ 32 => dl.i32_align = a,
+ 64 => dl.i64_align = a,
+ _ => {}
+ }
+ if bits >= i128_align_src && bits <= 128 {
+ // Default alignment for i128 is decided by taking the alignment of
+ // largest-sized i{64...128}.
+ i128_align_src = bits;
+ dl.i128_align = a;
+ }
+ }
+ [s, ref a..] if s.starts_with("v") => {
+ let v_size = size(&s[1..], "v")?;
+ let a = align(a, s)?;
+ if let Some(v) = dl.vector_align.iter_mut().find(|v| v.0 == v_size) {
+ v.1 = a;
+ continue;
+ }
+ // No existing entry, add a new one.
+ dl.vector_align.push((v_size, a));
+ }
+ _ => {} // Ignore everything else.
+ }
+ }
+
+ // Perform consistency checks against the Target information.
+ let endian_str = match dl.endian {
+ Endian::Little => "little",
+ Endian::Big => "big"
+ };
+ if endian_str != target.target_endian {
+ return Err(format!("inconsistent target specification: \"data-layout\" claims \
+ architecture is {}-endian, while \"target-endian\" is `{}`",
+ endian_str, target.target_endian));
+ }
+
+ if dl.pointer_size.bits().to_string() != target.target_pointer_width {
+ return Err(format!("inconsistent target specification: \"data-layout\" claims \
+ pointers are {}-bit, while \"target-pointer-width\" is `{}`",
+ dl.pointer_size.bits(), target.target_pointer_width));
+ }
+
+ Ok(dl)
+ }
+
+ /// Returns exclusive upper bound on object size.
+ ///
+ /// The theoretical maximum object size is defined as the maximum positive `isize` value.
+ /// This ensures that the `offset` semantics remain well-defined by allowing it to correctly
+ /// index every address within an object along with one byte past the end, along with allowing
+ /// `isize` to store the difference between any two pointers into an object.
+ ///
+ /// The upper bound on 64-bit currently needs to be lower because LLVM uses a 64-bit integer
+ /// to represent object size in bits. It would need to be 1 << 61 to account for this, but is
+ /// currently conservatively bounded to 1 << 47 as that is enough to cover the current usable
+ /// address space on 64-bit ARMv8 and x86_64.
+ pub fn obj_size_bound(&self) -> u64 {
+ match self.pointer_size.bits() {
+ 16 => 1 << 15,
+ 32 => 1 << 31,
+ 64 => 1 << 47,
+ bits => panic!("obj_size_bound: unknown pointer bit size {}", bits)
+ }
+ }
+
+ pub fn ptr_sized_integer(&self) -> Integer {
+ match self.pointer_size.bits() {
+ 16 => I16,
+ 32 => I32,
+ 64 => I64,
+ bits => panic!("ptr_sized_integer: unknown pointer bit size {}", bits)
+ }
+ }
+
+ pub fn vector_align(&self, vec_size: Size) -> AbiAndPrefAlign {
+ for &(size, align) in &self.vector_align {
+ if size == vec_size {
+ return align;
+ }
+ }
+ // Default to natural alignment, which is what LLVM does.
+ // That is, use the size, rounded up to a power of 2.
+ AbiAndPrefAlign::new(Align::from_bytes(vec_size.bytes().next_power_of_two()).unwrap())
+ }
+}
+
+pub trait HasDataLayout {
+ fn data_layout(&self) -> &TargetDataLayout;
+}
+
+impl HasDataLayout for TargetDataLayout {
+ fn data_layout(&self) -> &TargetDataLayout {
+ self
+ }
+}
+
+/// Endianness of the target, which must match cfg(target-endian).
+#[derive(Copy, Clone, PartialEq)]
+pub enum Endian {
+ Little,
+ Big
+}
+
+/// Size of a type in bytes.
+#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)]
+pub struct Size {
+ raw: u64
+}
+
+impl Size {
+ pub const ZERO: Size = Self::from_bytes(0);
+
+ #[inline]
+ pub fn from_bits(bits: u64) -> Size {
+ // Avoid potential overflow from `bits + 7`.
+ Size::from_bytes(bits / 8 + ((bits % 8) + 7) / 8)
+ }
+
+ #[inline]
+ pub const fn from_bytes(bytes: u64) -> Size {
+ Size {
+ raw: bytes
+ }
+ }
+
+ #[inline]
+ pub fn bytes(self) -> u64 {
+ self.raw
+ }
+
+ #[inline]
+ pub fn bits(self) -> u64 {
+ self.bytes().checked_mul(8).unwrap_or_else(|| {
+ panic!("Size::bits: {} bytes in bits doesn't fit in u64", self.bytes())
+ })
+ }
+
+ #[inline]
+ pub fn align_to(self, align: Align) -> Size {
+ let mask = align.bytes() - 1;
+ Size::from_bytes((self.bytes() + mask) & !mask)
+ }
+
+ #[inline]
+ pub fn is_aligned(self, align: Align) -> bool {
+ let mask = align.bytes() - 1;
+ self.bytes() & mask == 0
+ }
+
+ #[inline]
+ pub fn checked_add<C: HasDataLayout>(self, offset: Size, cx: &C) -> Option<Size> {
+ let dl = cx.data_layout();
+
+ let bytes = self.bytes().checked_add(offset.bytes())?;
+
+ if bytes < dl.obj_size_bound() {
+ Some(Size::from_bytes(bytes))
+ } else {
+ None
+ }
+ }
+
+ #[inline]
+ pub fn checked_mul<C: HasDataLayout>(self, count: u64, cx: &C) -> Option<Size> {
+ let dl = cx.data_layout();
+
+ let bytes = self.bytes().checked_mul(count)?;
+ if bytes < dl.obj_size_bound() {
+ Some(Size::from_bytes(bytes))
+ } else {
+ None
+ }
+ }
+}
+
+// Panicking addition, subtraction and multiplication for convenience.
+// Avoid during layout computation, return `LayoutError` instead.
+
+impl Add for Size {
+ type Output = Size;
+ #[inline]
+ fn add(self, other: Size) -> Size {
+ Size::from_bytes(self.bytes().checked_add(other.bytes()).unwrap_or_else(|| {
+ panic!("Size::add: {} + {} doesn't fit in u64", self.bytes(), other.bytes())
+ }))
+ }
+}
+
+impl Sub for Size {
+ type Output = Size;
+ #[inline]
+ fn sub(self, other: Size) -> Size {
+ Size::from_bytes(self.bytes().checked_sub(other.bytes()).unwrap_or_else(|| {
+ panic!("Size::sub: {} - {} would result in negative size", self.bytes(), other.bytes())
+ }))
+ }
+}
+
+impl Mul<Size> for u64 {
+ type Output = Size;
+ #[inline]
+ fn mul(self, size: Size) -> Size {
+ size * self
+ }
+}
+
+impl Mul<u64> for Size {
+ type Output = Size;
+ #[inline]
+ fn mul(self, count: u64) -> Size {
+ match self.bytes().checked_mul(count) {
+ Some(bytes) => Size::from_bytes(bytes),
+ None => {
+ panic!("Size::mul: {} * {} doesn't fit in u64", self.bytes(), count)
+ }
+ }
+ }
+}
+
+impl AddAssign for Size {
+ #[inline]
+ fn add_assign(&mut self, other: Size) {
+ *self = *self + other;
+ }
+}
+
+/// Alignment of a type in bytes (always a power of two).
+#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)]
+pub struct Align {
+ pow2: u8,
+}
+
+impl Align {
+ pub fn from_bits(bits: u64) -> Result<Align, String> {
+ Align::from_bytes(Size::from_bits(bits).bytes())
+ }
+
+ pub fn from_bytes(align: u64) -> Result<Align, String> {
+ // Treat an alignment of 0 bytes like 1-byte alignment.
+ if align == 0 {
+ return Ok(Align { pow2: 0 });
+ }
+
+ let mut bytes = align;
+ let mut pow2: u8 = 0;
+ while (bytes & 1) == 0 {
+ pow2 += 1;
+ bytes >>= 1;
+ }
+ if bytes != 1 {
+ return Err(format!("`{}` is not a power of 2", align));
+ }
+ if pow2 > 29 {
+ return Err(format!("`{}` is too large", align));
+ }
+
+ Ok(Align { pow2 })
+ }
+
+ pub fn bytes(self) -> u64 {
+ 1 << self.pow2
+ }
+
+ pub fn bits(self) -> u64 {
+ self.bytes() * 8
+ }
+
+ /// Computes the best alignment possible for the given offset
+ /// (the largest power of two that the offset is a multiple of).
+ ///
+ /// N.B., for an offset of `0`, this happens to return `2^64`.
+ pub fn max_for_offset(offset: Size) -> Align {
+ Align {
+ pow2: offset.bytes().trailing_zeros() as u8,
+ }
+ }
+
+ /// Lower the alignment, if necessary, such that the given offset
+ /// is aligned to it (the offset is a multiple of the alignment).
+ pub fn restrict_for_offset(self, offset: Size) -> Align {
+ self.min(Align::max_for_offset(offset))
+ }
+}
+
+/// A pair of aligments, ABI-mandated and preferred.
+#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable)]
+pub struct AbiAndPrefAlign {
+ pub abi: Align,
+ pub pref: Align,
+}
+
+impl AbiAndPrefAlign {
+ pub fn new(align: Align) -> AbiAndPrefAlign {
+ AbiAndPrefAlign {
+ abi: align,
+ pref: align,
+ }
+ }
+
+ pub fn min(self, other: AbiAndPrefAlign) -> AbiAndPrefAlign {
+ AbiAndPrefAlign {
+ abi: self.abi.min(other.abi),
+ pref: self.pref.min(other.pref),
+ }
+ }
+
+ pub fn max(self, other: AbiAndPrefAlign) -> AbiAndPrefAlign {
+ AbiAndPrefAlign {
+ abi: self.abi.max(other.abi),
+ pref: self.pref.max(other.pref),
+ }
+ }
+}
+
+/// Integers, also used for enum discriminants.
+#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
+pub enum Integer {
+ I8,
+ I16,
+ I32,
+ I64,
+ I128,
+}
+
+impl Integer {
+ pub fn size(self) -> Size {
+ match self {
+ I8 => Size::from_bytes(1),
+ I16 => Size::from_bytes(2),
+ I32 => Size::from_bytes(4),
+ I64 => Size::from_bytes(8),
+ I128 => Size::from_bytes(16),
+ }
+ }
+
+ pub fn align<C: HasDataLayout>(self, cx: &C) -> AbiAndPrefAlign {
+ let dl = cx.data_layout();
+
+ match self {
+ I8 => dl.i8_align,
+ I16 => dl.i16_align,
+ I32 => dl.i32_align,
+ I64 => dl.i64_align,
+ I128 => dl.i128_align,
+ }
+ }
+
+ /// Finds the smallest Integer type which can represent the signed value.
+ pub fn fit_signed(x: i128) -> Integer {
+ match x {
+ -0x0000_0000_0000_0080..=0x0000_0000_0000_007f => I8,
+ -0x0000_0000_0000_8000..=0x0000_0000_0000_7fff => I16,
+ -0x0000_0000_8000_0000..=0x0000_0000_7fff_ffff => I32,
+ -0x8000_0000_0000_0000..=0x7fff_ffff_ffff_ffff => I64,
+ _ => I128
+ }
+ }
+
+ /// Finds the smallest Integer type which can represent the unsigned value.
+ pub fn fit_unsigned(x: u128) -> Integer {
+ match x {
+ 0..=0x0000_0000_0000_00ff => I8,
+ 0..=0x0000_0000_0000_ffff => I16,
+ 0..=0x0000_0000_ffff_ffff => I32,
+ 0..=0xffff_ffff_ffff_ffff => I64,
+ _ => I128,
+ }
+ }
+
+ /// Finds the smallest integer with the given alignment.
+ pub fn for_align<C: HasDataLayout>(cx: &C, wanted: Align) -> Option<Integer> {
+ let dl = cx.data_layout();
+
+ for &candidate in &[I8, I16, I32, I64, I128] {
+ if wanted == candidate.align(dl).abi && wanted.bytes() == candidate.size().bytes() {
+ return Some(candidate);
+ }
+ }
+ None
+ }
+
+ /// Find the largest integer with the given alignment or less.
+ pub fn approximate_align<C: HasDataLayout>(cx: &C, wanted: Align) -> Integer {
+ let dl = cx.data_layout();
+
+ // FIXME(eddyb) maybe include I128 in the future, when it works everywhere.
+ for &candidate in &[I64, I32, I16] {
+ if wanted >= candidate.align(dl).abi && wanted.bytes() >= candidate.size().bytes() {
+ return candidate;
+ }
+ }
+ I8
+ }
+}
+
+
+#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy,
+ PartialOrd, Ord)]
+pub enum FloatTy {
+ F32,
+ F64,
+}
+
+impl fmt::Debug for FloatTy {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ fmt::Display::fmt(self, f)
+ }
+}
+
+impl fmt::Display for FloatTy {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "{}", self.ty_to_string())
+ }
+}
+
+impl FloatTy {
+ pub fn ty_to_string(self) -> &'static str {
+ match self {
+ FloatTy::F32 => "f32",
+ FloatTy::F64 => "f64",
+ }
+ }
+
+ pub fn bit_width(self) -> usize {
+ match self {
+ FloatTy::F32 => 32,
+ FloatTy::F64 => 64,
+ }
+ }
+}
+
+/// Fundamental unit of memory access and layout.
+#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
+pub enum Primitive {
+ /// The `bool` is the signedness of the `Integer` type.
+ ///
+ /// One would think we would not care about such details this low down,
+ /// but some ABIs are described in terms of C types and ISAs where the
+ /// integer arithmetic is done on {sign,zero}-extended registers, e.g.
+ /// a negative integer passed by zero-extension will appear positive in
+ /// the callee, and most operations on it will produce the wrong values.
+ Int(Integer, bool),
+ Float(FloatTy),
+ Pointer
+}
+
+impl<'a, 'tcx> Primitive {
+ pub fn size<C: HasDataLayout>(self, cx: &C) -> Size {
+ let dl = cx.data_layout();
+
+ match self {
+ Int(i, _) => i.size(),
+ Float(FloatTy::F32) => Size::from_bits(32),
+ Float(FloatTy::F64) => Size::from_bits(64),
+ Pointer => dl.pointer_size
+ }
+ }
+
+ pub fn align<C: HasDataLayout>(self, cx: &C) -> AbiAndPrefAlign {
+ let dl = cx.data_layout();
+
+ match self {
+ Int(i, _) => i.align(dl),
+ Float(FloatTy::F32) => dl.f32_align,
+ Float(FloatTy::F64) => dl.f64_align,
+ Pointer => dl.pointer_align
+ }
+ }
+
+ pub fn is_float(self) -> bool {
+ match self {
+ Float(_) => true,
+ _ => false
+ }
+ }
+
+ pub fn is_int(self) -> bool {
+ match self {
+ Int(..) => true,
+ _ => false,
+ }
+ }
+}
+
+/// Information about one scalar component of a Rust type.
+#[derive(Clone, PartialEq, Eq, Hash, Debug)]
+pub struct Scalar {
+ pub value: Primitive,
+
+ /// Inclusive wrap-around range of valid values, that is, if
+ /// start > end, it represents `start..=max_value()`,
+ /// followed by `0..=end`.
+ ///
+ /// That is, for an i8 primitive, a range of `254..=2` means following
+ /// sequence:
+ ///
+ /// 254 (-2), 255 (-1), 0, 1, 2
+ ///
+ /// This is intended specifically to mirror LLVM’s `!range` metadata,
+ /// semantics.
+ // FIXME(eddyb) always use the shortest range, e.g., by finding
+ // the largest space between two consecutive valid values and
+ // taking everything else as the (shortest) valid range.
+ pub valid_range: RangeInclusive<u128>,
+}
+
+impl Scalar {
+ pub fn is_bool(&self) -> bool {
+ if let Int(I8, _) = self.value {
+ self.valid_range == (0..=1)
+ } else {
+ false
+ }
+ }
+
+ /// Returns the valid range as a `x..y` range.
+ ///
+ /// If `x` and `y` are equal, the range is full, not empty.
+ pub fn valid_range_exclusive<C: HasDataLayout>(&self, cx: &C) -> Range<u128> {
+ // For a (max) value of -1, max will be `-1 as usize`, which overflows.
+ // However, that is fine here (it would still represent the full range),
+ // i.e., if the range is everything.
+ let bits = self.value.size(cx).bits();
+ assert!(bits <= 128);
+ let mask = !0u128 >> (128 - bits);
+ let start = *self.valid_range.start();
+ let end = *self.valid_range.end();
+ assert_eq!(start, start & mask);
+ assert_eq!(end, end & mask);
+ start..(end.wrapping_add(1) & mask)
+ }
+}
+
+/// Describes how the fields of a type are located in memory.
+#[derive(PartialEq, Eq, Hash, Debug)]
+pub enum FieldPlacement {
+ /// All fields start at no offset. The `usize` is the field count.
+ ///
+ /// In the case of primitives the number of fields is `0`.
+ Union(usize),
+
+ /// Array/vector-like placement, with all fields of identical types.
+ Array {
+ stride: Size,
+ count: u64
+ },
+
+ /// Struct-like placement, with precomputed offsets.
+ ///
+ /// Fields are guaranteed to not overlap, but note that gaps
+ /// before, between and after all the fields are NOT always
+ /// padding, and as such their contents may not be discarded.
+ /// For example, enum variants leave a gap at the start,
+ /// where the discriminant field in the enum layout goes.
+ Arbitrary {
+ /// Offsets for the first byte of each field,
+ /// ordered to match the source definition order.
+ /// This vector does not go in increasing order.
+ // FIXME(eddyb) use small vector optimization for the common case.
+ offsets: Vec<Size>,
+
+ /// Maps source order field indices to memory order indices,
+ /// depending how fields were permuted.
+ // FIXME(camlorn) also consider small vector optimization here.
+ memory_index: Vec<u32>
+ }
+}
+
+impl FieldPlacement {
+ pub fn count(&self) -> usize {
+ match *self {
+ FieldPlacement::Union(count) => count,
+ FieldPlacement::Array { count, .. } => {
+ let usize_count = count as usize;
+ assert_eq!(usize_count as u64, count);
+ usize_count
+ }
+ FieldPlacement::Arbitrary { ref offsets, .. } => offsets.len()
+ }
+ }
+
+ pub fn offset(&self, i: usize) -> Size {
+ match *self {
+ FieldPlacement::Union(_) => Size::ZERO,
+ FieldPlacement::Array { stride, count } => {
+ let i = i as u64;
+ assert!(i < count);
+ stride * i
+ }
+ FieldPlacement::Arbitrary { ref offsets, .. } => offsets[i]
+ }
+ }
+
+ pub fn memory_index(&self, i: usize) -> usize {
+ match *self {
+ FieldPlacement::Union(_) |
+ FieldPlacement::Array { .. } => i,
+ FieldPlacement::Arbitrary { ref memory_index, .. } => {
+ let r = memory_index[i];
+ assert_eq!(r as usize as u32, r);
+ r as usize
+ }
+ }
+ }
+
+ /// Gets source indices of the fields by increasing offsets.
+ #[inline]
+ pub fn index_by_increasing_offset<'a>(&'a self) -> impl Iterator<Item=usize>+'a {
+ let mut inverse_small = [0u8; 64];
+ let mut inverse_big = vec![];
+ let use_small = self.count() <= inverse_small.len();
+
+ // We have to write this logic twice in order to keep the array small.
+ if let FieldPlacement::Arbitrary { ref memory_index, .. } = *self {
+ if use_small {
+ for i in 0..self.count() {
+ inverse_small[memory_index[i] as usize] = i as u8;
+ }
+ } else {
+ inverse_big = vec![0; self.count()];
+ for i in 0..self.count() {
+ inverse_big[memory_index[i] as usize] = i as u32;
+ }
+ }
+ }
+
+ (0..self.count()).map(move |i| {
+ match *self {
+ FieldPlacement::Union(_) |
+ FieldPlacement::Array { .. } => i,
+ FieldPlacement::Arbitrary { .. } => {
+ if use_small { inverse_small[i] as usize }
+ else { inverse_big[i] as usize }
+ }
+ }
+ })
+ }
+}
+
+/// Describes how values of the type are passed by target ABIs,
+/// in terms of categories of C types there are ABI rules for.
+#[derive(Clone, PartialEq, Eq, Hash, Debug)]
+pub enum Abi {
+ Uninhabited,
+ Scalar(Scalar),
+ ScalarPair(Scalar, Scalar),
+ Vector {
+ element: Scalar,
+ count: u64
+ },
+ Aggregate {
+ /// If true, the size is exact, otherwise it's only a lower bound.
+ sized: bool,
+ }
+}
+
+impl Abi {
+ /// Returns `true` if the layout corresponds to an unsized type.
+ pub fn is_unsized(&self) -> bool {
+ match *self {
+ Abi::Uninhabited |
+ Abi::Scalar(_) |
+ Abi::ScalarPair(..) |
+ Abi::Vector { .. } => false,
+ Abi::Aggregate { sized } => !sized
+ }
+ }
+
+ /// Returns `true` if this is a single signed integer scalar
+ pub fn is_signed(&self) -> bool {
+ match *self {
+ Abi::Scalar(ref scal) => match scal.value {
+ Primitive::Int(_, signed) => signed,
+ _ => false,
+ },
+ _ => false,
+ }
+ }
+
+ /// Returns `true` if this is an uninhabited type
+ pub fn is_uninhabited(&self) -> bool {
+ match *self {
+ Abi::Uninhabited => true,
+ _ => false,
+ }
+ }
+}
+
+newtype_index! {
+ pub struct VariantIdx { .. }
+}
+
+#[derive(PartialEq, Eq, Hash, Debug)]
+pub enum Variants {
+ /// Single enum variants, structs/tuples, unions, and all non-ADTs.
+ Single {
+ index: VariantIdx,
+ },
+
+ /// General-case enums: for each case there is a struct, and they all have
+ /// all space reserved for the tag, and their first field starts
+ /// at a non-0 offset, after where the tag would go.
+ Tagged {
+ tag: Scalar,
+ variants: IndexVec<VariantIdx, LayoutDetails>,
+ },
+
+ /// Multiple cases distinguished by a niche (values invalid for a type):
+ /// the variant `dataful_variant` contains a niche at an arbitrary
+ /// offset (field 0 of the enum), which for a variant with discriminant
+ /// `d` is set to `(d - niche_variants.start).wrapping_add(niche_start)`.
+ ///
+ /// For example, `Option<(usize, &T)>` is represented such that
+ /// `None` has a null pointer for the second tuple field, and
+ /// `Some` is the identity function (with a non-null reference).
+ NicheFilling {
+ dataful_variant: VariantIdx,
+ niche_variants: RangeInclusive<VariantIdx>,
+ niche: Scalar,
+ niche_start: u128,
+ variants: IndexVec<VariantIdx, LayoutDetails>,
+ }
+}
+
+#[derive(PartialEq, Eq, Hash, Debug)]
+pub struct LayoutDetails {
+ pub variants: Variants,
+ pub fields: FieldPlacement,
+ pub abi: Abi,
+ pub align: AbiAndPrefAlign,
+ pub size: Size
+}
+
+impl LayoutDetails {
+ pub fn scalar<C: HasDataLayout>(cx: &C, scalar: Scalar) -> Self {
+ let size = scalar.value.size(cx);
+ let align = scalar.value.align(cx);
+ LayoutDetails {
+ variants: Variants::Single { index: VariantIdx::new(0) },
+ fields: FieldPlacement::Union(0),
+ abi: Abi::Scalar(scalar),
+ size,
+ align,
+ }
+ }
+}
+
+/// The details of the layout of a type, alongside the type itself.
+/// Provides various type traversal APIs (e.g., recursing into fields).
+///
+/// Note that the details are NOT guaranteed to always be identical
+/// to those obtained from `layout_of(ty)`, as we need to produce
+/// layouts for which Rust types do not exist, such as enum variants
+/// or synthetic fields of enums (i.e., discriminants) and fat pointers.
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+pub struct TyLayout<'a, Ty> {
+ pub ty: Ty,
+ pub details: &'a LayoutDetails
+}
+
+impl<'a, Ty> Deref for TyLayout<'a, Ty> {
+ type Target = &'a LayoutDetails;
+ fn deref(&self) -> &&'a LayoutDetails {
+ &self.details
+ }
+}
+
+pub trait LayoutOf {
+ type Ty;
+ type TyLayout;
+
+ fn layout_of(&self, ty: Self::Ty) -> Self::TyLayout;
+}
+
+pub trait TyLayoutMethods<'a, C: LayoutOf<Ty = Self>>: Sized {
+ fn for_variant(
+ this: TyLayout<'a, Self>,
+ cx: &C,
+ variant_index: VariantIdx,
+ ) -> TyLayout<'a, Self>;
+ fn field(this: TyLayout<'a, Self>, cx: &C, i: usize) -> C::TyLayout;
+}
+
+impl<'a, Ty> TyLayout<'a, Ty> {
+ pub fn for_variant<C>(self, cx: &C, variant_index: VariantIdx) -> Self
+ where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> {
+ Ty::for_variant(self, cx, variant_index)
+ }
+ pub fn field<C>(self, cx: &C, i: usize) -> C::TyLayout
+ where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> {
+ Ty::field(self, cx, i)
+ }
+}
+
+impl<'a, Ty> TyLayout<'a, Ty> {
+ /// Returns `true` if the layout corresponds to an unsized type.
+ pub fn is_unsized(&self) -> bool {
+ self.abi.is_unsized()
+ }
+
+ /// Returns `true` if the type is a ZST and not unsized.
+ pub fn is_zst(&self) -> bool {
+ match self.abi {
+ Abi::Scalar(_) |
+ Abi::ScalarPair(..) |
+ Abi::Vector { .. } => false,
+ Abi::Uninhabited => self.size.bytes() == 0,
+ Abi::Aggregate { sized } => sized && self.size.bytes() == 0
+ }
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/build.rs b/vendor/rustc-ap-rustc_target/build.rs
new file mode 100644
index 0000000..368200b
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/build.rs
@@ -0,0 +1,4 @@
+fn main() {
+ println!("cargo:rerun-if-changed=build.rs");
+ println!("cargo:rerun-if-env-changed=CFG_DEFAULT_LINKER");
+}
diff --git a/vendor/rustc-ap-rustc_target/lib.rs b/vendor/rustc-ap-rustc_target/lib.rs
new file mode 100644
index 0000000..758caf4
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/lib.rs
@@ -0,0 +1,33 @@
+//! Some stuff used by rustc that doesn't have many dependencies
+//!
+//! Originally extracted from rustc::back, which was nominally the
+//! compiler 'backend', though LLVM is rustc's backend, so rustc_target
+//! is really just odds-and-ends relating to code gen and linking.
+//! This crate mostly exists to make rustc smaller, so we might put
+//! more 'stuff' here in the future. It does not have a dependency on
+//! LLVM.
+
+#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
+
+#![feature(rustc_private, box_syntax)]
+#![feature(nll)]
+#![feature(rustc_attrs)]
+#![feature(slice_patterns)]
+#![feature(step_trait)]
+
+#![deny(rust_2018_idioms)]
+
+#[macro_use] extern crate log;
+
+#[allow(unused_extern_crates)]
+extern crate serialize as rustc_serialize; // used by deriving
+
+// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
+#[allow(unused_extern_crates)]
+extern crate rustc_cratesio_shim;
+
+#[macro_use]
+extern crate rustc_data_structures;
+
+pub mod abi;
+pub mod spec;
diff --git a/vendor/rustc-ap-rustc_target/spec/aarch64_apple_ios.rs b/vendor/rustc-ap-rustc_target/spec/aarch64_apple_ios.rs
new file mode 100644
index 0000000..8bdc08c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/aarch64_apple_ios.rs
@@ -0,0 +1,25 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+use super::apple_ios_base::{opts, Arch};
+
+pub fn target() -> TargetResult {
+ let base = opts(Arch::Arm64)?;
+ Ok(Target {
+ llvm_target: "arm64-apple-ios".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".to_string(),
+ arch: "aarch64".to_string(),
+ target_os: "ios".to_string(),
+ target_env: String::new(),
+ target_vendor: "apple".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ features: "+neon,+fp-armv8,+cyclone".to_string(),
+ eliminate_frame_pointer: false,
+ max_atomic_width: Some(128),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/aarch64_fuchsia.rs b/vendor/rustc-ap-rustc_target/spec/aarch64_fuchsia.rs
new file mode 100644
index 0000000..308954d
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/aarch64_fuchsia.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LldFlavor, LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::fuchsia_base::opts();
+ base.max_atomic_width = Some(128);
+
+ Ok(Target {
+ llvm_target: "aarch64-fuchsia".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
+ arch: "aarch64".to_string(),
+ target_os: "fuchsia".to_string(),
+ target_env: String::new(),
+ target_vendor: String::new(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+ options: TargetOptions {
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/aarch64_linux_android.rs b/vendor/rustc-ap-rustc_target/spec/aarch64_linux_android.rs
new file mode 100644
index 0000000..65160f6
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/aarch64_linux_android.rs
@@ -0,0 +1,28 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+// See https://developer.android.com/ndk/guides/abis.html#arm64-v8a
+// for target ABI requirements.
+
+pub fn target() -> TargetResult {
+ let mut base = super::android_base::opts();
+ base.max_atomic_width = Some(128);
+ // As documented in http://developer.android.com/ndk/guides/cpu-features.html
+ // the neon (ASIMD) and FP must exist on all android aarch64 targets.
+ base.features = "+neon,+fp-armv8".to_string();
+ Ok(Target {
+ llvm_target: "aarch64-linux-android".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
+ arch: "aarch64".to_string(),
+ target_os: "android".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/aarch64_pc_windows_msvc.rs b/vendor/rustc-ap-rustc_target/spec/aarch64_pc_windows_msvc.rs
new file mode 100644
index 0000000..1aee381
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/aarch64_pc_windows_msvc.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult, PanicStrategy};
+
+pub fn target() -> TargetResult {
+ let mut base = super::windows_msvc_base::opts();
+ base.max_atomic_width = Some(64);
+ base.has_elf_tls = true;
+
+ // FIXME: this shouldn't be panic=abort, it should be panic=unwind
+ base.panic_strategy = PanicStrategy::Abort;
+
+ Ok(Target {
+ llvm_target: "aarch64-pc-windows-msvc".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".to_string(),
+ arch: "aarch64".to_string(),
+ target_os: "windows".to_string(),
+ target_env: "msvc".to_string(),
+ target_vendor: "pc".to_string(),
+ linker_flavor: LinkerFlavor::Msvc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_cloudabi.rs b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_cloudabi.rs
new file mode 100644
index 0000000..7141954
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_cloudabi.rs
@@ -0,0 +1,22 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::cloudabi_base::opts();
+ base.max_atomic_width = Some(128);
+ base.abi_blacklist = super::arm_base::abi_blacklist();
+ base.linker = Some("aarch64-unknown-cloudabi-cc".to_string());
+
+ Ok(Target {
+ llvm_target: "aarch64-unknown-cloudabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
+ arch: "aarch64".to_string(),
+ target_os: "cloudabi".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_freebsd.rs b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_freebsd.rs
new file mode 100644
index 0000000..3686064
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_freebsd.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::freebsd_base::opts();
+ base.max_atomic_width = Some(128);
+
+ Ok(Target {
+ llvm_target: "aarch64-unknown-freebsd".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
+ arch: "aarch64".to_string(),
+ target_os: "freebsd".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_hermit.rs b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_hermit.rs
new file mode 100644
index 0000000..7b02060
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_hermit.rs
@@ -0,0 +1,22 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::hermit_base::opts();
+ base.max_atomic_width = Some(128);
+ base.abi_blacklist = super::arm_base::abi_blacklist();
+ base.linker = Some("aarch64-hermit-gcc".to_string());
+
+ Ok(Target {
+ llvm_target: "aarch64-unknown-hermit".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
+ arch: "aarch64".to_string(),
+ target_os: "hermit".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_linux_gnu.rs b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_linux_gnu.rs
new file mode 100644
index 0000000..e772d8b
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_linux_gnu.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_base::opts();
+ base.max_atomic_width = Some(128);
+
+ Ok(Target {
+ llvm_target: "aarch64-unknown-linux-gnu".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ target_env: "gnu".to_string(),
+ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
+ arch: "aarch64".to_string(),
+ target_os: "linux".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_linux_musl.rs b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_linux_musl.rs
new file mode 100644
index 0000000..8123ee8
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_linux_musl.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_musl_base::opts();
+ base.max_atomic_width = Some(128);
+
+ Ok(Target {
+ llvm_target: "aarch64-unknown-linux-musl".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ target_env: "musl".to_string(),
+ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
+ arch: "aarch64".to_string(),
+ target_os: "linux".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_netbsd.rs b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_netbsd.rs
new file mode 100644
index 0000000..47ae08a
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_netbsd.rs
@@ -0,0 +1,21 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::netbsd_base::opts();
+ base.max_atomic_width = Some(128);
+ base.abi_blacklist = super::arm_base::abi_blacklist();
+
+ Ok(Target {
+ llvm_target: "aarch64-unknown-netbsd".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
+ arch: "aarch64".to_string(),
+ target_os: "netbsd".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_none.rs b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_none.rs
new file mode 100644
index 0000000..8c02bc6
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_none.rs
@@ -0,0 +1,37 @@
+// Generic AArch64 target for bare-metal code
+//
+// Can be used in conjunction with the `target-feature` and
+// `target-cpu` compiler flags to opt-in more hardware-specific
+// features.
+//
+// For example, `-C target-cpu=cortex-a53`.
+
+use super::{LldFlavor, LinkerFlavor, Target, TargetOptions, PanicStrategy};
+
+pub fn target() -> Result<Target, String> {
+ let opts = TargetOptions {
+ linker: Some("rust-lld".to_owned()),
+ features: "+strict-align".to_string(),
+ executables: true,
+ relocation_model: "static".to_string(),
+ disable_redzone: true,
+ linker_is_gnu: true,
+ max_atomic_width: Some(128),
+ panic_strategy: PanicStrategy::Abort,
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. Default::default()
+ };
+ Ok(Target {
+ llvm_target: "aarch64-unknown-none".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: String::new(),
+ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
+ arch: "aarch64".to_string(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+ options: opts,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_openbsd.rs b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_openbsd.rs
new file mode 100644
index 0000000..c9cd64c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/aarch64_unknown_openbsd.rs
@@ -0,0 +1,21 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::openbsd_base::opts();
+ base.max_atomic_width = Some(128);
+ base.abi_blacklist = super::arm_base::abi_blacklist();
+
+ Ok(Target {
+ llvm_target: "aarch64-unknown-openbsd".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
+ arch: "aarch64".to_string(),
+ target_os: "openbsd".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/abi.rs b/vendor/rustc-ap-rustc_target/spec/abi.rs
new file mode 100644
index 0000000..c9c41f1
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/abi.rs
@@ -0,0 +1,128 @@
+use std::fmt;
+
+#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, Clone, Copy, Debug)]
+pub enum Abi {
+ // N.B., this ordering MUST match the AbiDatas array below.
+ // (This is ensured by the test indices_are_correct().)
+
+ // Single platform ABIs
+ Cdecl,
+ Stdcall,
+ Fastcall,
+ Vectorcall,
+ Thiscall,
+ Aapcs,
+ Win64,
+ SysV64,
+ PtxKernel,
+ Msp430Interrupt,
+ X86Interrupt,
+ AmdGpuKernel,
+
+ // Multiplatform / generic ABIs
+ Rust,
+ C,
+ System,
+ RustIntrinsic,
+ RustCall,
+ PlatformIntrinsic,
+ Unadjusted
+}
+
+#[derive(Copy, Clone)]
+pub struct AbiData {
+ abi: Abi,
+
+ /// Name of this ABI as we like it called.
+ name: &'static str,
+
+ /// A generic ABI is supported on all platforms.
+ generic: bool,
+}
+
+#[allow(non_upper_case_globals)]
+const AbiDatas: &[AbiData] = &[
+ // Platform-specific ABIs
+ AbiData {abi: Abi::Cdecl, name: "cdecl", generic: false },
+ AbiData {abi: Abi::Stdcall, name: "stdcall", generic: false },
+ AbiData {abi: Abi::Fastcall, name: "fastcall", generic: false },
+ AbiData {abi: Abi::Vectorcall, name: "vectorcall", generic: false},
+ AbiData {abi: Abi::Thiscall, name: "thiscall", generic: false},
+ AbiData {abi: Abi::Aapcs, name: "aapcs", generic: false },
+ AbiData {abi: Abi::Win64, name: "win64", generic: false },
+ AbiData {abi: Abi::SysV64, name: "sysv64", generic: false },
+ AbiData {abi: Abi::PtxKernel, name: "ptx-kernel", generic: false },
+ AbiData {abi: Abi::Msp430Interrupt, name: "msp430-interrupt", generic: false },
+ AbiData {abi: Abi::X86Interrupt, name: "x86-interrupt", generic: false },
+ AbiData {abi: Abi::AmdGpuKernel, name: "amdgpu-kernel", generic: false },
+
+ // Cross-platform ABIs
+ AbiData {abi: Abi::Rust, name: "Rust", generic: true },
+ AbiData {abi: Abi::C, name: "C", generic: true },
+ AbiData {abi: Abi::System, name: "system", generic: true },
+ AbiData {abi: Abi::RustIntrinsic, name: "rust-intrinsic", generic: true },
+ AbiData {abi: Abi::RustCall, name: "rust-call", generic: true },
+ AbiData {abi: Abi::PlatformIntrinsic, name: "platform-intrinsic", generic: true },
+ AbiData {abi: Abi::Unadjusted, name: "unadjusted", generic: true },
+];
+
+/// Returns the ABI with the given name (if any).
+pub fn lookup(name: &str) -> Option<Abi> {
+ AbiDatas.iter().find(|abi_data| name == abi_data.name).map(|&x| x.abi)
+}
+
+pub fn all_names() -> Vec<&'static str> {
+ AbiDatas.iter().map(|d| d.name).collect()
+}
+
+impl Abi {
+ #[inline]
+ pub fn index(self) -> usize {
+ self as usize
+ }
+
+ #[inline]
+ pub fn data(self) -> &'static AbiData {
+ &AbiDatas[self.index()]
+ }
+
+ pub fn name(self) -> &'static str {
+ self.data().name
+ }
+
+ pub fn generic(self) -> bool {
+ self.data().generic
+ }
+}
+
+impl fmt::Display for Abi {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "\"{}\"", self.name())
+ }
+}
+
+#[allow(non_snake_case)]
+#[test]
+fn lookup_Rust() {
+ let abi = lookup("Rust");
+ assert!(abi.is_some() && abi.unwrap().data().name == "Rust");
+}
+
+#[test]
+fn lookup_cdecl() {
+ let abi = lookup("cdecl");
+ assert!(abi.is_some() && abi.unwrap().data().name == "cdecl");
+}
+
+#[test]
+fn lookup_baz() {
+ let abi = lookup("baz");
+ assert!(abi.is_none());
+}
+
+#[test]
+fn indices_are_correct() {
+ for (i, abi_data) in AbiDatas.iter().enumerate() {
+ assert_eq!(i, abi_data.abi.index());
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/android_base.rs b/vendor/rustc-ap-rustc_target/spec/android_base.rs
new file mode 100644
index 0000000..684c059
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/android_base.rs
@@ -0,0 +1,14 @@
+use crate::spec::{LinkerFlavor, TargetOptions};
+
+pub fn opts() -> TargetOptions {
+ let mut base = super::linux_base::opts();
+ // Many of the symbols defined in compiler-rt are also defined in libgcc.
+ // Android's linker doesn't like that by default.
+ base.pre_link_args
+ .get_mut(&LinkerFlavor::Gcc).unwrap().push("-Wl,--allow-multiple-definition".to_string());
+ base.is_like_android = true;
+ base.position_independent_executables = true;
+ base.has_elf_tls = false;
+ base.requires_uwtable = true;
+ base
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/apple_base.rs b/vendor/rustc-ap-rustc_target/spec/apple_base.rs
new file mode 100644
index 0000000..c21f7f3
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/apple_base.rs
@@ -0,0 +1,42 @@
+use std::env;
+
+use crate::spec::{LinkArgs, TargetOptions};
+
+pub fn opts() -> TargetOptions {
+ // ELF TLS is only available in macOS 10.7+. If you try to compile for 10.6
+ // either the linker will complain if it is used or the binary will end up
+ // segfaulting at runtime when run on 10.6. Rust by default supports macOS
+ // 10.7+, but there is a standard environment variable,
+ // MACOSX_DEPLOYMENT_TARGET, which is used to signal targeting older
+ // versions of macOS. For example compiling on 10.10 with
+ // MACOSX_DEPLOYMENT_TARGET set to 10.6 will cause the linker to generate
+ // warnings about the usage of ELF TLS.
+ //
+ // Here we detect what version is being requested, defaulting to 10.7. ELF
+ // TLS is flagged as enabled if it looks to be supported.
+ let deployment_target = env::var("MACOSX_DEPLOYMENT_TARGET").ok();
+ let version = deployment_target.as_ref().and_then(|s| {
+ let mut i = s.splitn(2, '.');
+ i.next().and_then(|a| i.next().map(|b| (a, b)))
+ }).and_then(|(a, b)| {
+ a.parse::<u32>().and_then(|a| b.parse::<u32>().map(|b| (a, b))).ok()
+ }).unwrap_or((10, 7));
+
+ TargetOptions {
+ // macOS has -dead_strip, which doesn't rely on function_sections
+ function_sections: false,
+ dynamic_linking: true,
+ executables: true,
+ target_family: Some("unix".to_string()),
+ is_like_osx: true,
+ has_rpath: true,
+ dll_prefix: "lib".to_string(),
+ dll_suffix: ".dylib".to_string(),
+ archive_format: "bsd".to_string(),
+ pre_link_args: LinkArgs::new(),
+ has_elf_tls: version >= (10, 7),
+ abi_return_struct_as_int: true,
+ emit_debug_gdb_scripts: false,
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/apple_ios_base.rs b/vendor/rustc-ap-rustc_target/spec/apple_ios_base.rs
new file mode 100644
index 0000000..3068ed8
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/apple_ios_base.rs
@@ -0,0 +1,96 @@
+use std::io;
+use std::process::Command;
+use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions};
+
+use Arch::*;
+
+#[allow(non_camel_case_types)]
+#[derive(Copy, Clone)]
+pub enum Arch {
+ Armv7,
+ Armv7s,
+ Arm64,
+ I386,
+ X86_64
+}
+
+impl Arch {
+ pub fn to_string(self) -> &'static str {
+ match self {
+ Armv7 => "armv7",
+ Armv7s => "armv7s",
+ Arm64 => "arm64",
+ I386 => "i386",
+ X86_64 => "x86_64"
+ }
+ }
+}
+
+pub fn get_sdk_root(sdk_name: &str) -> Result<String, String> {
+ let res = Command::new("xcrun")
+ .arg("--show-sdk-path")
+ .arg("-sdk")
+ .arg(sdk_name)
+ .output()
+ .and_then(|output| {
+ if output.status.success() {
+ Ok(String::from_utf8(output.stdout).unwrap())
+ } else {
+ let error = String::from_utf8(output.stderr);
+ let error = format!("process exit with error: {}",
+ error.unwrap());
+ Err(io::Error::new(io::ErrorKind::Other,
+ &error[..]))
+ }
+ });
+
+ match res {
+ Ok(output) => Ok(output.trim().to_string()),
+ Err(e) => Err(format!("failed to get {} SDK path: {}", sdk_name, e))
+ }
+}
+
+fn build_pre_link_args(arch: Arch) -> Result<LinkArgs, String> {
+ let sdk_name = match arch {
+ Armv7 | Armv7s | Arm64 => "iphoneos",
+ I386 | X86_64 => "iphonesimulator"
+ };
+
+ let arch_name = arch.to_string();
+
+ let sdk_root = get_sdk_root(sdk_name)?;
+
+ let mut args = LinkArgs::new();
+ args.insert(LinkerFlavor::Gcc,
+ vec!["-arch".to_string(),
+ arch_name.to_string(),
+ "-isysroot".to_string(),
+ sdk_root.clone(),
+ "-Wl,-syslibroot".to_string(),
+ sdk_root]);
+
+ Ok(args)
+}
+
+fn target_cpu(arch: Arch) -> String {
+ match arch {
+ Armv7 => "cortex-a8", // iOS7 is supported on iPhone 4 and higher
+ Armv7s => "cortex-a9",
+ Arm64 => "cyclone",
+ I386 => "yonah",
+ X86_64 => "core2",
+ }.to_string()
+}
+
+pub fn opts(arch: Arch) -> Result<TargetOptions, String> {
+ let pre_link_args = build_pre_link_args(arch)?;
+ Ok(TargetOptions {
+ cpu: target_cpu(arch),
+ dynamic_linking: false,
+ executables: true,
+ pre_link_args,
+ has_elf_tls: false,
+ eliminate_frame_pointer: false,
+ .. super::apple_base::opts()
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/arm_base.rs b/vendor/rustc-ap-rustc_target/spec/arm_base.rs
new file mode 100644
index 0000000..77e7bfa
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/arm_base.rs
@@ -0,0 +1,6 @@
+use crate::spec::abi::Abi;
+
+// All the calling conventions trigger an assertion(Unsupported calling convention) in llvm on arm
+pub fn abi_blacklist() -> Vec<Abi> {
+ vec![Abi::Stdcall, Abi::Fastcall, Abi::Vectorcall, Abi::Thiscall, Abi::Win64, Abi::SysV64]
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/arm_linux_androideabi.rs b/vendor/rustc-ap-rustc_target/spec/arm_linux_androideabi.rs
new file mode 100644
index 0000000..bb066dc
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/arm_linux_androideabi.rs
@@ -0,0 +1,25 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::android_base::opts();
+ // https://developer.android.com/ndk/guides/abis.html#armeabi
+ base.features = "+strict-align,+v5te".to_string();
+ base.max_atomic_width = Some(32);
+
+ Ok(Target {
+ llvm_target: "arm-linux-androideabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "android".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/arm_unknown_linux_gnueabi.rs b/vendor/rustc-ap-rustc_target/spec/arm_unknown_linux_gnueabi.rs
new file mode 100644
index 0000000..f291818
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/arm_unknown_linux_gnueabi.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_base::opts();
+ base.max_atomic_width = Some(64);
+ Ok(Target {
+ llvm_target: "arm-unknown-linux-gnueabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ features: "+strict-align,+v6".to_string(),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/arm_unknown_linux_gnueabihf.rs b/vendor/rustc-ap-rustc_target/spec/arm_unknown_linux_gnueabihf.rs
new file mode 100644
index 0000000..32b509d
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/arm_unknown_linux_gnueabihf.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_base::opts();
+ base.max_atomic_width = Some(64);
+ Ok(Target {
+ llvm_target: "arm-unknown-linux-gnueabihf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ features: "+strict-align,+v6,+vfp2".to_string(),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/arm_unknown_linux_musleabi.rs b/vendor/rustc-ap-rustc_target/spec/arm_unknown_linux_musleabi.rs
new file mode 100644
index 0000000..7637577
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/arm_unknown_linux_musleabi.rs
@@ -0,0 +1,29 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_musl_base::opts();
+
+ // Most of these settings are copied from the arm_unknown_linux_gnueabi
+ // target.
+ base.features = "+strict-align,+v6".to_string();
+ base.max_atomic_width = Some(64);
+ Ok(Target {
+ // It's important we use "gnueabi" and not "musleabi" here. LLVM uses it
+ // to determine the calling convention and float ABI, and it doesn't
+ // support the "musleabi" value.
+ llvm_target: "arm-unknown-linux-gnueabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "musl".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/arm_unknown_linux_musleabihf.rs b/vendor/rustc-ap-rustc_target/spec/arm_unknown_linux_musleabihf.rs
new file mode 100644
index 0000000..9def151
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/arm_unknown_linux_musleabihf.rs
@@ -0,0 +1,29 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_musl_base::opts();
+
+ // Most of these settings are copied from the arm_unknown_linux_gnueabihf
+ // target.
+ base.features = "+strict-align,+v6,+vfp2".to_string();
+ base.max_atomic_width = Some(64);
+ Ok(Target {
+ // It's important we use "gnueabihf" and not "musleabihf" here. LLVM
+ // uses it to determine the calling convention and float ABI, and it
+ // doesn't support the "musleabihf" value.
+ llvm_target: "arm-unknown-linux-gnueabihf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "musl".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armebv7r_none_eabi.rs b/vendor/rustc-ap-rustc_target/spec/armebv7r_none_eabi.rs
new file mode 100644
index 0000000..86c62da
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armebv7r_none_eabi.rs
@@ -0,0 +1,30 @@
+// Targets the Big endian Cortex-R4/R5 processor (ARMv7-R)
+
+use std::default::Default;
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "armebv7r-unknown-none-eabi".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "none".to_string(),
+ target_env: "".to_string(),
+ target_vendor: "".to_string(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ executables: true,
+ linker: Some("rust-lld".to_owned()),
+ relocation_model: "static".to_string(),
+ panic_strategy: PanicStrategy::Abort,
+ max_atomic_width: Some(32),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ emit_debug_gdb_scripts: false,
+ .. Default::default()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armebv7r_none_eabihf.rs b/vendor/rustc-ap-rustc_target/spec/armebv7r_none_eabihf.rs
new file mode 100644
index 0000000..50ee764
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armebv7r_none_eabihf.rs
@@ -0,0 +1,31 @@
+// Targets the Cortex-R4F/R5F processor (ARMv7-R)
+
+use std::default::Default;
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "armebv7r-unknown-none-eabihf".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: String::new(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ executables: true,
+ linker: Some("rust-lld".to_owned()),
+ relocation_model: "static".to_string(),
+ panic_strategy: PanicStrategy::Abort,
+ features: "+vfp3,+d16,+fp-only-sp".to_string(),
+ max_atomic_width: Some(32),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ emit_debug_gdb_scripts: false,
+ .. Default::default()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv4t_unknown_linux_gnueabi.rs b/vendor/rustc-ap-rustc_target/spec/armv4t_unknown_linux_gnueabi.rs
new file mode 100644
index 0000000..7cd4b14
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv4t_unknown_linux_gnueabi.rs
@@ -0,0 +1,25 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let base = super::linux_base::opts();
+ Ok(Target {
+ llvm_target: "armv4t-unknown-linux-gnueabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ features: "+soft-float,+strict-align".to_string(),
+ // Atomic operations provided by compiler-builtins
+ max_atomic_width: Some(32),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv5te_unknown_linux_gnueabi.rs b/vendor/rustc-ap-rustc_target/spec/armv5te_unknown_linux_gnueabi.rs
new file mode 100644
index 0000000..15f6148
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv5te_unknown_linux_gnueabi.rs
@@ -0,0 +1,25 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let base = super::linux_base::opts();
+ Ok(Target {
+ llvm_target: "armv5te-unknown-linux-gnueabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ features: "+soft-float,+strict-align".to_string(),
+ // Atomic operations provided by compiler-builtins
+ max_atomic_width: Some(32),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv5te_unknown_linux_musleabi.rs b/vendor/rustc-ap-rustc_target/spec/armv5te_unknown_linux_musleabi.rs
new file mode 100644
index 0000000..74915b9
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv5te_unknown_linux_musleabi.rs
@@ -0,0 +1,28 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let base = super::linux_musl_base::opts();
+ Ok(Target {
+ // It's important we use "gnueabihf" and not "musleabihf" here. LLVM
+ // uses it to determine the calling convention and float ABI, and LLVM
+ // doesn't support the "musleabihf" value.
+ llvm_target: "armv5te-unknown-linux-gnueabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "musl".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ features: "+soft-float,+strict-align".to_string(),
+ // Atomic operations provided by compiler-builtins
+ max_atomic_width: Some(32),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv6_unknown_freebsd.rs b/vendor/rustc-ap-rustc_target/spec/armv6_unknown_freebsd.rs
new file mode 100644
index 0000000..39886a1
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv6_unknown_freebsd.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let base = super::freebsd_base::opts();
+ Ok(Target {
+ llvm_target: "armv6-unknown-freebsd-gnueabihf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "freebsd".to_string(),
+ target_env: "gnueabihf".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ features: "+v6,+vfp2".to_string(),
+ max_atomic_width: Some(64),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv6_unknown_netbsd_eabihf.rs b/vendor/rustc-ap-rustc_target/spec/armv6_unknown_netbsd_eabihf.rs
new file mode 100644
index 0000000..e460b6c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv6_unknown_netbsd_eabihf.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::netbsd_base::opts();
+ base.max_atomic_width = Some(64);
+ Ok(Target {
+ llvm_target: "armv6-unknown-netbsdelf-eabihf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "netbsd".to_string(),
+ target_env: "eabihf".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ features: "+v6,+vfp2".to_string(),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv7_apple_ios.rs b/vendor/rustc-ap-rustc_target/spec/armv7_apple_ios.rs
new file mode 100644
index 0000000..2052d17
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv7_apple_ios.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+use super::apple_ios_base::{opts, Arch};
+
+pub fn target() -> TargetResult {
+ let base = opts(Arch::Armv7)?;
+ Ok(Target {
+ llvm_target: "armv7-apple-ios".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(),
+ arch: "arm".to_string(),
+ target_os: "ios".to_string(),
+ target_env: String::new(),
+ target_vendor: "apple".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ features: "+v7,+vfp3,+neon".to_string(),
+ max_atomic_width: Some(64),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv7_linux_androideabi.rs b/vendor/rustc-ap-rustc_target/spec/armv7_linux_androideabi.rs
new file mode 100644
index 0000000..92f1a55
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv7_linux_androideabi.rs
@@ -0,0 +1,34 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+// This target if is for the baseline of the Android v7a ABI
+// in thumb mode. It's named armv7-* instead of thumbv7-*
+// for historical reasons. See the thumbv7neon variant for
+// enabling NEON.
+
+// See https://developer.android.com/ndk/guides/abis.html#v7a
+// for target ABI requirements.
+
+pub fn target() -> TargetResult {
+ let mut base = super::android_base::opts();
+ base.features = "+v7,+thumb-mode,+thumb2,+vfp3,+d16,-neon".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args
+ .get_mut(&LinkerFlavor::Gcc).unwrap().push("-march=armv7-a".to_string());
+
+ Ok(Target {
+ llvm_target: "armv7-none-linux-android".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "android".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv7_unknown_cloudabi_eabihf.rs b/vendor/rustc-ap-rustc_target/spec/armv7_unknown_cloudabi_eabihf.rs
new file mode 100644
index 0000000..a6c7fb5
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv7_unknown_cloudabi_eabihf.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::cloudabi_base::opts();
+ base.cpu = "cortex-a8".to_string();
+ base.max_atomic_width = Some(64);
+ base.features = "+v7,+vfp3,+neon".to_string();
+ base.abi_blacklist = super::arm_base::abi_blacklist();
+ base.linker = Some("armv7-unknown-cloudabi-eabihf-cc".to_string());
+
+ Ok(Target {
+ llvm_target: "armv7-unknown-cloudabi-eabihf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "cloudabi".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv7_unknown_freebsd.rs b/vendor/rustc-ap-rustc_target/spec/armv7_unknown_freebsd.rs
new file mode 100644
index 0000000..ba63fd2
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv7_unknown_freebsd.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let base = super::freebsd_base::opts();
+ Ok(Target {
+ llvm_target: "armv7-unknown-freebsd-gnueabihf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "freebsd".to_string(),
+ target_env: "gnueabihf".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(),
+ max_atomic_width: Some(64),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv7_unknown_linux_gnueabihf.rs b/vendor/rustc-ap-rustc_target/spec/armv7_unknown_linux_gnueabihf.rs
new file mode 100644
index 0000000..f162154
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv7_unknown_linux_gnueabihf.rs
@@ -0,0 +1,29 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+// This target is for glibc Linux on ARMv7 without NEON or
+// thumb-mode. See the thumbv7neon variant for enabling both.
+
+pub fn target() -> TargetResult {
+ let base = super::linux_base::opts();
+ Ok(Target {
+ llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ // Info about features at https://wiki.debian.org/ArmHardFloatPort
+ features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(),
+ cpu: "generic".to_string(),
+ max_atomic_width: Some(64),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv7_unknown_linux_musleabihf.rs b/vendor/rustc-ap-rustc_target/spec/armv7_unknown_linux_musleabihf.rs
new file mode 100644
index 0000000..45a2696
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv7_unknown_linux_musleabihf.rs
@@ -0,0 +1,32 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+// This target is for musl Linux on ARMv7 without thumb-mode or NEON.
+
+pub fn target() -> TargetResult {
+ let base = super::linux_musl_base::opts();
+ Ok(Target {
+ // It's important we use "gnueabihf" and not "musleabihf" here. LLVM
+ // uses it to determine the calling convention and float ABI, and LLVM
+ // doesn't support the "musleabihf" value.
+ llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "musl".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ // Most of these settings are copied from the armv7_unknown_linux_gnueabihf
+ // target.
+ options: TargetOptions {
+ features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(),
+ cpu: "generic".to_string(),
+ max_atomic_width: Some(64),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv7_unknown_netbsd_eabihf.rs b/vendor/rustc-ap-rustc_target/spec/armv7_unknown_netbsd_eabihf.rs
new file mode 100644
index 0000000..44e2636
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv7_unknown_netbsd_eabihf.rs
@@ -0,0 +1,25 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ let base = super::netbsd_base::opts();
+ Ok(Target {
+ llvm_target: "armv7-unknown-netbsdelf-eabihf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "netbsd".to_string(),
+ target_env: "eabihf".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(),
+ cpu: "generic".to_string(),
+ max_atomic_width: Some(64),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv7r_none_eabi.rs b/vendor/rustc-ap-rustc_target/spec/armv7r_none_eabi.rs
new file mode 100644
index 0000000..19d3324
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv7r_none_eabi.rs
@@ -0,0 +1,30 @@
+// Targets the Little-endian Cortex-R4/R5 processor (ARMv7-R)
+
+use std::default::Default;
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "armv7r-unknown-none-eabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "none".to_string(),
+ target_env: "".to_string(),
+ target_vendor: "".to_string(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ executables: true,
+ linker: Some("rust-lld".to_owned()),
+ relocation_model: "static".to_string(),
+ panic_strategy: PanicStrategy::Abort,
+ max_atomic_width: Some(32),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ emit_debug_gdb_scripts: false,
+ .. Default::default()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv7r_none_eabihf.rs b/vendor/rustc-ap-rustc_target/spec/armv7r_none_eabihf.rs
new file mode 100644
index 0000000..06ef9f3
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv7r_none_eabihf.rs
@@ -0,0 +1,31 @@
+// Targets the Little-endian Cortex-R4F/R5F processor (ARMv7-R)
+
+use std::default::Default;
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "armv7r-unknown-none-eabihf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "none".to_string(),
+ target_env: "".to_string(),
+ target_vendor: "".to_string(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ executables: true,
+ linker: Some("rust-lld".to_owned()),
+ relocation_model: "static".to_string(),
+ panic_strategy: PanicStrategy::Abort,
+ features: "+vfp3,+d16,+fp-only-sp".to_string(),
+ max_atomic_width: Some(32),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ emit_debug_gdb_scripts: false,
+ .. Default::default()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/armv7s_apple_ios.rs b/vendor/rustc-ap-rustc_target/spec/armv7s_apple_ios.rs
new file mode 100644
index 0000000..29e2902
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/armv7s_apple_ios.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+use super::apple_ios_base::{opts, Arch};
+
+pub fn target() -> TargetResult {
+ let base = opts(Arch::Armv7s)?;
+ Ok(Target {
+ llvm_target: "armv7s-apple-ios".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(),
+ arch: "arm".to_string(),
+ target_os: "ios".to_string(),
+ target_env: String::new(),
+ target_vendor: "apple".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ features: "+v7,+vfp4,+neon".to_string(),
+ max_atomic_width: Some(64),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/asmjs_unknown_emscripten.rs b/vendor/rustc-ap-rustc_target/spec/asmjs_unknown_emscripten.rs
new file mode 100644
index 0000000..6dc140c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/asmjs_unknown_emscripten.rs
@@ -0,0 +1,40 @@
+use super::{LinkArgs, LinkerFlavor, Target, TargetOptions};
+
+pub fn target() -> Result<Target, String> {
+ let mut args = LinkArgs::new();
+ args.insert(LinkerFlavor::Em,
+ vec!["-s".to_string(),
+ "ERROR_ON_UNDEFINED_SYMBOLS=1".to_string(),
+ "-s".to_string(),
+ "ABORTING_MALLOC=0".to_string(),
+ "-s".to_string(),
+ "WASM=0".to_string()]);
+
+ let opts = TargetOptions {
+ dynamic_linking: false,
+ executables: true,
+ exe_suffix: ".js".to_string(),
+ linker_is_gnu: true,
+ allow_asm: false,
+ obj_is_bitcode: true,
+ is_like_emscripten: true,
+ max_atomic_width: Some(32),
+ post_link_args: args,
+ target_family: Some("unix".to_string()),
+ codegen_backend: "emscripten".to_string(),
+ .. Default::default()
+ };
+ Ok(Target {
+ llvm_target: "asmjs-unknown-emscripten".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ target_os: "emscripten".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ data_layout: "e-p:32:32-i64:64-v128:32:128-n32-S128".to_string(),
+ arch: "asmjs".to_string(),
+ linker_flavor: LinkerFlavor::Em,
+ options: opts,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/bitrig_base.rs b/vendor/rustc-ap-rustc_target/spec/bitrig_base.rs
new file mode 100644
index 0000000..9b34119
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/bitrig_base.rs
@@ -0,0 +1,16 @@
+use crate::spec::{TargetOptions, RelroLevel};
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ TargetOptions {
+ dynamic_linking: true,
+ executables: true,
+ target_family: Some("unix".to_string()),
+ linker_is_gnu: true,
+ has_rpath: true,
+ position_independent_executables: true,
+ relro_level: RelroLevel::Full,
+
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/cloudabi_base.rs b/vendor/rustc-ap-rustc_target/spec/cloudabi_base.rs
new file mode 100644
index 0000000..a34122d
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/cloudabi_base.rs
@@ -0,0 +1,33 @@
+use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions, RelroLevel};
+
+pub fn opts() -> TargetOptions {
+ let mut args = LinkArgs::new();
+ args.insert(LinkerFlavor::Gcc, vec![
+ "-Wl,-Bstatic".to_string(),
+ "-Wl,--no-dynamic-linker".to_string(),
+ "-Wl,--eh-frame-hdr".to_string(),
+ "-Wl,--gc-sections".to_string(),
+ ]);
+
+ TargetOptions {
+ executables: true,
+ target_family: None,
+ linker_is_gnu: true,
+ pre_link_args: args,
+ position_independent_executables: true,
+ // As CloudABI only supports static linkage, there is no need
+ // for dynamic TLS. The C library therefore does not provide
+ // __tls_get_addr(), which is normally used to perform dynamic
+ // TLS lookups by programs that make use of dlopen(). Only the
+ // "local-exec" and "initial-exec" TLS models can be used.
+ //
+ // "local-exec" is more efficient than "initial-exec", as the
+ // latter has one more level of indirection: it accesses the GOT
+ // (Global Offset Table) to obtain the effective address of a
+ // thread-local variable. Using a GOT is useful only when doing
+ // dynamic linking.
+ tls_model: "local-exec".to_string(),
+ relro_level: RelroLevel::Full,
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/dragonfly_base.rs b/vendor/rustc-ap-rustc_target/spec/dragonfly_base.rs
new file mode 100644
index 0000000..766030e80
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/dragonfly_base.rs
@@ -0,0 +1,28 @@
+use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions, RelroLevel};
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ let mut args = LinkArgs::new();
+ args.insert(LinkerFlavor::Gcc, vec![
+ // GNU-style linkers will use this to omit linking to libraries
+ // which don't actually fulfill any relocations, but only for
+ // libraries which follow this flag. Thus, use it before
+ // specifying libraries to link to.
+ "-Wl,--as-needed".to_string(),
+
+ // Always enable NX protection when it is available
+ "-Wl,-z,noexecstack".to_string(),
+ ]);
+
+ TargetOptions {
+ dynamic_linking: true,
+ executables: true,
+ target_family: Some("unix".to_string()),
+ linker_is_gnu: true,
+ has_rpath: true,
+ pre_link_args: args,
+ position_independent_executables: true,
+ relro_level: RelroLevel::Full,
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/freebsd_base.rs b/vendor/rustc-ap-rustc_target/spec/freebsd_base.rs
new file mode 100644
index 0000000..51f030f
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/freebsd_base.rs
@@ -0,0 +1,30 @@
+use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions, RelroLevel};
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ let mut args = LinkArgs::new();
+ args.insert(LinkerFlavor::Gcc, vec![
+ // GNU-style linkers will use this to omit linking to libraries
+ // which don't actually fulfill any relocations, but only for
+ // libraries which follow this flag. Thus, use it before
+ // specifying libraries to link to.
+ "-Wl,--as-needed".to_string(),
+
+ // Always enable NX protection when it is available
+ "-Wl,-z,noexecstack".to_string(),
+ ]);
+
+ TargetOptions {
+ dynamic_linking: true,
+ executables: true,
+ target_family: Some("unix".to_string()),
+ linker_is_gnu: true,
+ has_rpath: true,
+ pre_link_args: args,
+ position_independent_executables: true,
+ eliminate_frame_pointer: false, // FIXME 43575
+ relro_level: RelroLevel::Full,
+ abi_return_struct_as_int: true,
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/fuchsia_base.rs b/vendor/rustc-ap-rustc_target/spec/fuchsia_base.rs
new file mode 100644
index 0000000..4e4f2fa
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/fuchsia_base.rs
@@ -0,0 +1,30 @@
+use crate::spec::{LldFlavor, LinkArgs, LinkerFlavor, TargetOptions};
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ let mut pre_link_args = LinkArgs::new();
+ pre_link_args.insert(LinkerFlavor::Lld(LldFlavor::Ld), vec![
+ "--build-id".to_string(),
+ "--eh-frame-hdr".to_string(),
+ "--hash-style=gnu".to_string(),
+ "-z".to_string(), "rodynamic".to_string(),
+ ]);
+
+ TargetOptions {
+ linker: Some("rust-lld".to_owned()),
+ lld_flavor: LldFlavor::Ld,
+ dynamic_linking: true,
+ executables: true,
+ target_family: Some("unix".to_string()),
+ is_like_fuchsia: true,
+ linker_is_gnu: true,
+ has_rpath: false,
+ pre_link_args: pre_link_args,
+ pre_link_objects_exe: vec![
+ "Scrt1.o".to_string()
+ ],
+ position_independent_executables: true,
+ has_elf_tls: true,
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/haiku_base.rs b/vendor/rustc-ap-rustc_target/spec/haiku_base.rs
new file mode 100644
index 0000000..d071062
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/haiku_base.rs
@@ -0,0 +1,14 @@
+use crate::spec::{TargetOptions, RelroLevel};
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ TargetOptions {
+ dynamic_linking: true,
+ executables: true,
+ has_rpath: false,
+ target_family: Some("unix".to_string()),
+ relro_level: RelroLevel::Full,
+ linker_is_gnu: true,
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/hermit_base.rs b/vendor/rustc-ap-rustc_target/spec/hermit_base.rs
new file mode 100644
index 0000000..ee75339
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/hermit_base.rs
@@ -0,0 +1,26 @@
+use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, TargetOptions};
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ let mut args = LinkArgs::new();
+ args.insert(LinkerFlavor::Gcc, vec![
+ "-Wl,-Bstatic".to_string(),
+ "-Wl,--no-dynamic-linker".to_string(),
+ "-Wl,--gc-sections".to_string(),
+ "-Wl,--as-needed".to_string(),
+ ]);
+
+ TargetOptions {
+ executables: true,
+ has_elf_tls: true,
+ linker_is_gnu: true,
+ no_default_libraries: false,
+ panic_strategy: PanicStrategy::Abort,
+ position_independent_executables: false,
+ pre_link_args: args,
+ relocation_model: "static".to_string(),
+ target_family: Some("unix".to_string()),
+ tls_model: "local-exec".to_string(),
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i386_apple_ios.rs b/vendor/rustc-ap-rustc_target/spec/i386_apple_ios.rs
new file mode 100644
index 0000000..78e9cbb
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i386_apple_ios.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+use super::apple_ios_base::{opts, Arch};
+
+pub fn target() -> TargetResult {
+ let base = opts(Arch::I386)?;
+ Ok(Target {
+ llvm_target: "i386-apple-ios".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128".to_string(),
+ arch: "x86".to_string(),
+ target_os: "ios".to_string(),
+ target_env: String::new(),
+ target_vendor: "apple".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ max_atomic_width: Some(64),
+ stack_probes: true,
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i586_pc_windows_msvc.rs b/vendor/rustc-ap-rustc_target/spec/i586_pc_windows_msvc.rs
new file mode 100644
index 0000000..ba712ac
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i586_pc_windows_msvc.rs
@@ -0,0 +1,8 @@
+use crate::spec::TargetResult;
+
+pub fn target() -> TargetResult {
+ let mut base = super::i686_pc_windows_msvc::target()?;
+ base.options.cpu = "pentium".to_string();
+ base.llvm_target = "i586-pc-windows-msvc".to_string();
+ Ok(base)
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i586_unknown_linux_gnu.rs b/vendor/rustc-ap-rustc_target/spec/i586_unknown_linux_gnu.rs
new file mode 100644
index 0000000..49f4f2c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i586_unknown_linux_gnu.rs
@@ -0,0 +1,8 @@
+use crate::spec::TargetResult;
+
+pub fn target() -> TargetResult {
+ let mut base = super::i686_unknown_linux_gnu::target()?;
+ base.options.cpu = "pentium".to_string();
+ base.llvm_target = "i586-unknown-linux-gnu".to_string();
+ Ok(base)
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i586_unknown_linux_musl.rs b/vendor/rustc-ap-rustc_target/spec/i586_unknown_linux_musl.rs
new file mode 100644
index 0000000..0f2cceb
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i586_unknown_linux_musl.rs
@@ -0,0 +1,8 @@
+use crate::spec::TargetResult;
+
+pub fn target() -> TargetResult {
+ let mut base = super::i686_unknown_linux_musl::target()?;
+ base.options.cpu = "pentium".to_string();
+ base.llvm_target = "i586-unknown-linux-musl".to_string();
+ Ok(base)
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i686_apple_darwin.rs b/vendor/rustc-ap-rustc_target/spec/i686_apple_darwin.rs
new file mode 100644
index 0000000..c8a6129
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i686_apple_darwin.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::apple_base::opts();
+ base.cpu = "yonah".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m32".to_string()]);
+ base.stack_probes = true;
+ base.eliminate_frame_pointer = false;
+
+ Ok(Target {
+ llvm_target: "i686-apple-darwin".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128".to_string(),
+ arch: "x86".to_string(),
+ target_os: "macos".to_string(),
+ target_env: String::new(),
+ target_vendor: "apple".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i686_linux_android.rs b/vendor/rustc-ap-rustc_target/spec/i686_linux_android.rs
new file mode 100644
index 0000000..3f73d24
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i686_linux_android.rs
@@ -0,0 +1,29 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+// See https://developer.android.com/ndk/guides/abis.html#x86
+// for target ABI requirements.
+
+pub fn target() -> TargetResult {
+ let mut base = super::android_base::opts();
+
+ base.max_atomic_width = Some(64);
+
+ // http://developer.android.com/ndk/guides/abis.html#x86
+ base.cpu = "pentiumpro".to_string();
+ base.features = "+mmx,+sse,+sse2,+sse3,+ssse3".to_string();
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "i686-linux-android".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(),
+ arch: "x86".to_string(),
+ target_os: "android".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i686_pc_windows_gnu.rs b/vendor/rustc-ap-rustc_target/spec/i686_pc_windows_gnu.rs
new file mode 100644
index 0000000..12214a7
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i686_pc_windows_gnu.rs
@@ -0,0 +1,27 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::windows_base::opts();
+ base.cpu = "pentium4".to_string();
+ base.max_atomic_width = Some(64);
+ base.eliminate_frame_pointer = false; // Required for backtraces
+
+ // Mark all dynamic libraries and executables as compatible with the larger 4GiB address
+ // space available to x86 Windows binaries on x86_64.
+ base.pre_link_args
+ .get_mut(&LinkerFlavor::Gcc).unwrap().push("-Wl,--large-address-aware".to_string());
+
+ Ok(Target {
+ llvm_target: "i686-pc-windows-gnu".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32".to_string(),
+ arch: "x86".to_string(),
+ target_os: "windows".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "pc".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i686_pc_windows_msvc.rs b/vendor/rustc-ap-rustc_target/spec/i686_pc_windows_msvc.rs
new file mode 100644
index 0000000..1967834
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i686_pc_windows_msvc.rs
@@ -0,0 +1,31 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::windows_msvc_base::opts();
+ base.cpu = "pentium4".to_string();
+ base.max_atomic_width = Some(64);
+
+ // Mark all dynamic libraries and executables as compatible with the larger 4GiB address
+ // space available to x86 Windows binaries on x86_64.
+ base.pre_link_args
+ .get_mut(&LinkerFlavor::Msvc).unwrap().push("/LARGEADDRESSAWARE".to_string());
+
+ // Ensure the linker will only produce an image if it can also produce a table of
+ // the image's safe exception handlers.
+ // https://msdn.microsoft.com/en-us/library/9a89h429.aspx
+ base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap().push("/SAFESEH".to_string());
+
+ Ok(Target {
+ llvm_target: "i686-pc-windows-msvc".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32".to_string(),
+ arch: "x86".to_string(),
+ target_os: "windows".to_string(),
+ target_env: "msvc".to_string(),
+ target_vendor: "pc".to_string(),
+ linker_flavor: LinkerFlavor::Msvc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i686_unknown_cloudabi.rs b/vendor/rustc-ap-rustc_target/spec/i686_unknown_cloudabi.rs
new file mode 100644
index 0000000..f3b4063
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i686_unknown_cloudabi.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::cloudabi_base::opts();
+ base.cpu = "pentium4".to_string();
+ base.max_atomic_width = Some(64);
+ base.linker = Some("i686-unknown-cloudabi-cc".to_string());
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "i686-unknown-cloudabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(),
+ arch: "x86".to_string(),
+ target_os: "cloudabi".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i686_unknown_dragonfly.rs b/vendor/rustc-ap-rustc_target/spec/i686_unknown_dragonfly.rs
new file mode 100644
index 0000000..20315e7
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i686_unknown_dragonfly.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::dragonfly_base::opts();
+ base.cpu = "pentium4".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "i686-unknown-dragonfly".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(),
+ arch: "x86".to_string(),
+ target_os: "dragonfly".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i686_unknown_freebsd.rs b/vendor/rustc-ap-rustc_target/spec/i686_unknown_freebsd.rs
new file mode 100644
index 0000000..71f05a1
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i686_unknown_freebsd.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::freebsd_base::opts();
+ base.cpu = "pentium4".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "i686-unknown-freebsd".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(),
+ arch: "x86".to_string(),
+ target_os: "freebsd".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i686_unknown_haiku.rs b/vendor/rustc-ap-rustc_target/spec/i686_unknown_haiku.rs
new file mode 100644
index 0000000..b807e4e
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i686_unknown_haiku.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::haiku_base::opts();
+ base.cpu = "pentium4".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m32".to_string()]);
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "i686-unknown-haiku".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(),
+ arch: "x86".to_string(),
+ target_os: "haiku".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i686_unknown_linux_gnu.rs b/vendor/rustc-ap-rustc_target/spec/i686_unknown_linux_gnu.rs
new file mode 100644
index 0000000..5875cbf
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i686_unknown_linux_gnu.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_base::opts();
+ base.cpu = "pentium4".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "i686-unknown-linux-gnu".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(),
+ arch: "x86".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i686_unknown_linux_musl.rs b/vendor/rustc-ap-rustc_target/spec/i686_unknown_linux_musl.rs
new file mode 100644
index 0000000..7329490
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i686_unknown_linux_musl.rs
@@ -0,0 +1,38 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_musl_base::opts();
+ base.cpu = "pentium4".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-Wl,-melf_i386".to_string());
+ base.stack_probes = true;
+
+ // The unwinder used by i686-unknown-linux-musl, the LLVM libunwind
+ // implementation, apparently relies on frame pointers existing... somehow.
+ // It's not clear to me why nor where this dependency is introduced, but the
+ // test suite does not pass with frame pointers eliminated and it passes
+ // with frame pointers present.
+ //
+ // If you think that this is no longer necessary, then please feel free to
+ // ignore! If it still passes the test suite and the bots then sounds good
+ // to me.
+ //
+ // This may or may not be related to this bug:
+ // https://llvm.org/bugs/show_bug.cgi?id=30879
+ base.eliminate_frame_pointer = false;
+
+ Ok(Target {
+ llvm_target: "i686-unknown-linux-musl".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(),
+ arch: "x86".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "musl".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i686_unknown_netbsd.rs b/vendor/rustc-ap-rustc_target/spec/i686_unknown_netbsd.rs
new file mode 100644
index 0000000..e8a9f29
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i686_unknown_netbsd.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::netbsd_base::opts();
+ base.cpu = "pentium4".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "i686-unknown-netbsdelf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(),
+ arch: "x86".to_string(),
+ target_os: "netbsd".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/i686_unknown_openbsd.rs b/vendor/rustc-ap-rustc_target/spec/i686_unknown_openbsd.rs
new file mode 100644
index 0000000..d7c323e
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/i686_unknown_openbsd.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::openbsd_base::opts();
+ base.cpu = "pentium4".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-fuse-ld=lld".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "i686-unknown-openbsd".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(),
+ arch: "x86".to_string(),
+ target_os: "openbsd".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/l4re_base.rs b/vendor/rustc-ap-rustc_target/spec/l4re_base.rs
new file mode 100644
index 0000000..9317f05
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/l4re_base.rs
@@ -0,0 +1,29 @@
+use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, TargetOptions};
+use std::default::Default;
+//use std::process::Command;
+
+// Use GCC to locate code for crt* libraries from the host, not from L4Re. Note
+// that a few files also come from L4Re, for these, the function shouldn't be
+// used. This uses GCC for the location of the file, but GCC is required for L4Re anyway.
+//fn get_path_or(filename: &str) -> String {
+// let child = Command::new("gcc")
+// .arg(format!("-print-file-name={}", filename)).output()
+// .expect("Failed to execute GCC");
+// String::from_utf8(child.stdout)
+// .expect("Couldn't read path from GCC").trim().into()
+//}
+
+pub fn opts() -> TargetOptions {
+ let mut args = LinkArgs::new();
+ args.insert(LinkerFlavor::Gcc, vec![]);
+
+ TargetOptions {
+ executables: true,
+ has_elf_tls: false,
+ panic_strategy: PanicStrategy::Abort,
+ linker: Some("ld".to_string()),
+ pre_link_args: args,
+ target_family: Some("unix".to_string()),
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/linux_base.rs b/vendor/rustc-ap-rustc_target/spec/linux_base.rs
new file mode 100644
index 0000000..195fba3
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/linux_base.rs
@@ -0,0 +1,32 @@
+use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions, RelroLevel};
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ let mut args = LinkArgs::new();
+ args.insert(LinkerFlavor::Gcc, vec![
+ // We want to be able to strip as much executable code as possible
+ // from the linker command line, and this flag indicates to the
+ // linker that it can avoid linking in dynamic libraries that don't
+ // actually satisfy any symbols up to that point (as with many other
+ // resolutions the linker does). This option only applies to all
+ // following libraries so we're sure to pass it as one of the first
+ // arguments.
+ "-Wl,--as-needed".to_string(),
+
+ // Always enable NX protection when it is available
+ "-Wl,-z,noexecstack".to_string(),
+ ]);
+
+ TargetOptions {
+ dynamic_linking: true,
+ executables: true,
+ target_family: Some("unix".to_string()),
+ linker_is_gnu: true,
+ has_rpath: true,
+ pre_link_args: args,
+ position_independent_executables: true,
+ relro_level: RelroLevel::Full,
+ has_elf_tls: true,
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/linux_musl_base.rs b/vendor/rustc-ap-rustc_target/spec/linux_musl_base.rs
new file mode 100644
index 0000000..e294e63
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/linux_musl_base.rs
@@ -0,0 +1,34 @@
+use crate::spec::{LinkerFlavor, TargetOptions};
+
+pub fn opts() -> TargetOptions {
+ let mut base = super::linux_base::opts();
+
+ // Make sure that the linker/gcc really don't pull in anything, including
+ // default objects, libs, etc.
+ base.pre_link_args_crt.insert(LinkerFlavor::Gcc, Vec::new());
+ base.pre_link_args_crt.get_mut(&LinkerFlavor::Gcc).unwrap().push("-nostdlib".to_string());
+
+ // At least when this was tested, the linker would not add the
+ // `GNU_EH_FRAME` program header to executables generated, which is required
+ // when unwinding to locate the unwinding information. I'm not sure why this
+ // argument is *not* necessary for normal builds, but it can't hurt!
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-Wl,--eh-frame-hdr".to_string());
+
+ // When generating a statically linked executable there's generally some
+ // small setup needed which is listed in these files. These are provided by
+ // a musl toolchain and are linked by default by the `musl-gcc` script. Note
+ // that `gcc` also does this by default, it just uses some different files.
+ //
+ // Each target directory for musl has these object files included in it so
+ // they'll be included from there.
+ base.pre_link_objects_exe_crt.push("crt1.o".to_string());
+ base.pre_link_objects_exe_crt.push("crti.o".to_string());
+ base.post_link_objects_crt.push("crtn.o".to_string());
+
+ // These targets statically link libc by default
+ base.crt_static_default = true;
+ // These targets allow the user to choose between static and dynamic linking.
+ base.crt_static_respected = true;
+
+ base
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/mips64_unknown_linux_gnuabi64.rs b/vendor/rustc-ap-rustc_target/spec/mips64_unknown_linux_gnuabi64.rs
new file mode 100644
index 0000000..3b38e64
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/mips64_unknown_linux_gnuabi64.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "mips64-unknown-linux-gnuabi64".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
+ arch: "mips64".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ // NOTE(mips64r2) matches C toolchain
+ cpu: "mips64r2".to_string(),
+ features: "+mips64r2".to_string(),
+ max_atomic_width: Some(64),
+
+ ..super::linux_base::opts()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/mips64el_unknown_linux_gnuabi64.rs b/vendor/rustc-ap-rustc_target/spec/mips64el_unknown_linux_gnuabi64.rs
new file mode 100644
index 0000000..0f6cd86
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/mips64el_unknown_linux_gnuabi64.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "mips64el-unknown-linux-gnuabi64".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
+ arch: "mips64".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ // NOTE(mips64r2) matches C toolchain
+ cpu: "mips64r2".to_string(),
+ features: "+mips64r2".to_string(),
+ max_atomic_width: Some(64),
+
+ ..super::linux_base::opts()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/mips_unknown_linux_gnu.rs b/vendor/rustc-ap-rustc_target/spec/mips_unknown_linux_gnu.rs
new file mode 100644
index 0000000..b4d29c5
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/mips_unknown_linux_gnu.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "mips-unknown-linux-gnu".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
+ arch: "mips".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ cpu: "mips32r2".to_string(),
+ features: "+mips32r2,+fpxx,+nooddspreg".to_string(),
+ max_atomic_width: Some(32),
+
+ ..super::linux_base::opts()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/mips_unknown_linux_musl.rs b/vendor/rustc-ap-rustc_target/spec/mips_unknown_linux_musl.rs
new file mode 100644
index 0000000..c56c6e3
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/mips_unknown_linux_musl.rs
@@ -0,0 +1,22 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_musl_base::opts();
+ base.cpu = "mips32r2".to_string();
+ base.features = "+mips32r2,+soft-float".to_string();
+ base.max_atomic_width = Some(32);
+ base.crt_static_default = false;
+ Ok(Target {
+ llvm_target: "mips-unknown-linux-musl".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
+ arch: "mips".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "musl".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/mips_unknown_linux_uclibc.rs b/vendor/rustc-ap-rustc_target/spec/mips_unknown_linux_uclibc.rs
new file mode 100644
index 0000000..cb02769
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/mips_unknown_linux_uclibc.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "mips-unknown-linux-uclibc".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
+ arch: "mips".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "uclibc".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ cpu: "mips32r2".to_string(),
+ features: "+mips32r2,+soft-float".to_string(),
+ max_atomic_width: Some(32),
+
+ ..super::linux_base::opts()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/mipsel_unknown_linux_gnu.rs b/vendor/rustc-ap-rustc_target/spec/mipsel_unknown_linux_gnu.rs
new file mode 100644
index 0000000..ed49ddd
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/mipsel_unknown_linux_gnu.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "mipsel-unknown-linux-gnu".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
+ arch: "mips".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ cpu: "mips32r2".to_string(),
+ features: "+mips32r2,+fpxx,+nooddspreg".to_string(),
+ max_atomic_width: Some(32),
+
+ ..super::linux_base::opts()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/mipsel_unknown_linux_musl.rs b/vendor/rustc-ap-rustc_target/spec/mipsel_unknown_linux_musl.rs
new file mode 100644
index 0000000..bcc49cf
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/mipsel_unknown_linux_musl.rs
@@ -0,0 +1,22 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_musl_base::opts();
+ base.cpu = "mips32r2".to_string();
+ base.features = "+mips32r2,+soft-float".to_string();
+ base.max_atomic_width = Some(32);
+ base.crt_static_default = false;
+ Ok(Target {
+ llvm_target: "mipsel-unknown-linux-musl".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
+ arch: "mips".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "musl".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/mipsel_unknown_linux_uclibc.rs b/vendor/rustc-ap-rustc_target/spec/mipsel_unknown_linux_uclibc.rs
new file mode 100644
index 0000000..205f328
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/mipsel_unknown_linux_uclibc.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "mipsel-unknown-linux-uclibc".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
+ arch: "mips".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "uclibc".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ cpu: "mips32r2".to_string(),
+ features: "+mips32r2,+soft-float".to_string(),
+ max_atomic_width: Some(32),
+
+ ..super::linux_base::opts()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/mod.rs b/vendor/rustc-ap-rustc_target/spec/mod.rs
new file mode 100644
index 0000000..2824d9c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/mod.rs
@@ -0,0 +1,1428 @@
+//! [Flexible target specification.](https://github.com/rust-lang/rfcs/pull/131)
+//!
+//! Rust targets a wide variety of usecases, and in the interest of flexibility,
+//! allows new target triples to be defined in configuration files. Most users
+//! will not need to care about these, but this is invaluable when porting Rust
+//! to a new platform, and allows for an unprecedented level of control over how
+//! the compiler works.
+//!
+//! # Using custom targets
+//!
+//! A target triple, as passed via `rustc --target=TRIPLE`, will first be
+//! compared against the list of built-in targets. This is to ease distributing
+//! rustc (no need for configuration files) and also to hold these built-in
+//! targets as immutable and sacred. If `TRIPLE` is not one of the built-in
+//! targets, rustc will check if a file named `TRIPLE` exists. If it does, it
+//! will be loaded as the target configuration. If the file does not exist,
+//! rustc will search each directory in the environment variable
+//! `RUST_TARGET_PATH` for a file named `TRIPLE.json`. The first one found will
+//! be loaded. If no file is found in any of those directories, a fatal error
+//! will be given.
+//!
+//! Projects defining their own targets should use
+//! `--target=path/to/my-awesome-platform.json` instead of adding to
+//! `RUST_TARGET_PATH`.
+//!
+//! # Defining a new target
+//!
+//! Targets are defined using [JSON](http://json.org/). The `Target` struct in
+//! this module defines the format the JSON file should take, though each
+//! underscore in the field names should be replaced with a hyphen (`-`) in the
+//! JSON file. Some fields are required in every target specification, such as
+//! `llvm-target`, `target-endian`, `target-pointer-width`, `data-layout`,
+//! `arch`, and `os`. In general, options passed to rustc with `-C` override
+//! the target's settings, though `target-feature` and `link-args` will *add*
+//! to the list specified by the target, rather than replace.
+
+use serialize::json::{Json, ToJson};
+use std::collections::BTreeMap;
+use std::default::Default;
+use std::{fmt, io};
+use std::path::{Path, PathBuf};
+use std::str::FromStr;
+use crate::spec::abi::{Abi, lookup as lookup_abi};
+
+pub mod abi;
+mod android_base;
+mod apple_base;
+mod apple_ios_base;
+mod arm_base;
+mod bitrig_base;
+mod cloudabi_base;
+mod dragonfly_base;
+mod freebsd_base;
+mod haiku_base;
+mod hermit_base;
+mod linux_base;
+mod linux_musl_base;
+mod openbsd_base;
+mod netbsd_base;
+mod solaris_base;
+mod uefi_base;
+mod windows_base;
+mod windows_msvc_base;
+mod thumb_base;
+mod l4re_base;
+mod fuchsia_base;
+mod redox_base;
+mod riscv_base;
+
+#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Hash,
+ RustcEncodable, RustcDecodable)]
+pub enum LinkerFlavor {
+ Em,
+ Gcc,
+ Ld,
+ Msvc,
+ Lld(LldFlavor),
+ PtxLinker,
+}
+
+#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Hash,
+ RustcEncodable, RustcDecodable)]
+pub enum LldFlavor {
+ Wasm,
+ Ld64,
+ Ld,
+ Link,
+}
+
+impl LldFlavor {
+ fn from_str(s: &str) -> Option<Self> {
+ Some(match s {
+ "darwin" => LldFlavor::Ld64,
+ "gnu" => LldFlavor::Ld,
+ "link" => LldFlavor::Link,
+ "wasm" => LldFlavor::Wasm,
+ _ => return None,
+ })
+ }
+}
+
+impl ToJson for LldFlavor {
+ fn to_json(&self) -> Json {
+ match *self {
+ LldFlavor::Ld64 => "darwin",
+ LldFlavor::Ld => "gnu",
+ LldFlavor::Link => "link",
+ LldFlavor::Wasm => "wasm",
+ }.to_json()
+ }
+}
+
+impl ToJson for LinkerFlavor {
+ fn to_json(&self) -> Json {
+ self.desc().to_json()
+ }
+}
+macro_rules! flavor_mappings {
+ ($((($($flavor:tt)*), $string:expr),)*) => (
+ impl LinkerFlavor {
+ pub const fn one_of() -> &'static str {
+ concat!("one of: ", $($string, " ",)+)
+ }
+
+ pub fn from_str(s: &str) -> Option<Self> {
+ Some(match s {
+ $($string => $($flavor)*,)+
+ _ => return None,
+ })
+ }
+
+ pub fn desc(&self) -> &str {
+ match *self {
+ $($($flavor)* => $string,)+
+ }
+ }
+ }
+ )
+}
+
+
+flavor_mappings! {
+ ((LinkerFlavor::Em), "em"),
+ ((LinkerFlavor::Gcc), "gcc"),
+ ((LinkerFlavor::Ld), "ld"),
+ ((LinkerFlavor::Msvc), "msvc"),
+ ((LinkerFlavor::PtxLinker), "ptx-linker"),
+ ((LinkerFlavor::Lld(LldFlavor::Wasm)), "wasm-ld"),
+ ((LinkerFlavor::Lld(LldFlavor::Ld64)), "ld64.lld"),
+ ((LinkerFlavor::Lld(LldFlavor::Ld)), "ld.lld"),
+ ((LinkerFlavor::Lld(LldFlavor::Link)), "lld-link"),
+}
+
+#[derive(Clone, Copy, Debug, PartialEq, Hash, RustcEncodable, RustcDecodable)]
+pub enum PanicStrategy {
+ Unwind,
+ Abort,
+}
+
+impl PanicStrategy {
+ pub fn desc(&self) -> &str {
+ match *self {
+ PanicStrategy::Unwind => "unwind",
+ PanicStrategy::Abort => "abort",
+ }
+ }
+}
+
+impl ToJson for PanicStrategy {
+ fn to_json(&self) -> Json {
+ match *self {
+ PanicStrategy::Abort => "abort".to_json(),
+ PanicStrategy::Unwind => "unwind".to_json(),
+ }
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq, Hash, RustcEncodable, RustcDecodable)]
+pub enum RelroLevel {
+ Full,
+ Partial,
+ Off,
+ None,
+}
+
+impl RelroLevel {
+ pub fn desc(&self) -> &str {
+ match *self {
+ RelroLevel::Full => "full",
+ RelroLevel::Partial => "partial",
+ RelroLevel::Off => "off",
+ RelroLevel::None => "none",
+ }
+ }
+}
+
+impl FromStr for RelroLevel {
+ type Err = ();
+
+ fn from_str(s: &str) -> Result<RelroLevel, ()> {
+ match s {
+ "full" => Ok(RelroLevel::Full),
+ "partial" => Ok(RelroLevel::Partial),
+ "off" => Ok(RelroLevel::Off),
+ "none" => Ok(RelroLevel::None),
+ _ => Err(()),
+ }
+ }
+}
+
+impl ToJson for RelroLevel {
+ fn to_json(&self) -> Json {
+ match *self {
+ RelroLevel::Full => "full".to_json(),
+ RelroLevel::Partial => "partial".to_json(),
+ RelroLevel::Off => "off".to_json(),
+ RelroLevel::None => "None".to_json(),
+ }
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq, Hash, RustcEncodable, RustcDecodable)]
+pub enum MergeFunctions {
+ Disabled,
+ Trampolines,
+ Aliases
+}
+
+impl MergeFunctions {
+ pub fn desc(&self) -> &str {
+ match *self {
+ MergeFunctions::Disabled => "disabled",
+ MergeFunctions::Trampolines => "trampolines",
+ MergeFunctions::Aliases => "aliases",
+ }
+ }
+}
+
+impl FromStr for MergeFunctions {
+ type Err = ();
+
+ fn from_str(s: &str) -> Result<MergeFunctions, ()> {
+ match s {
+ "disabled" => Ok(MergeFunctions::Disabled),
+ "trampolines" => Ok(MergeFunctions::Trampolines),
+ "aliases" => Ok(MergeFunctions::Aliases),
+ _ => Err(()),
+ }
+ }
+}
+
+impl ToJson for MergeFunctions {
+ fn to_json(&self) -> Json {
+ match *self {
+ MergeFunctions::Disabled => "disabled".to_json(),
+ MergeFunctions::Trampolines => "trampolines".to_json(),
+ MergeFunctions::Aliases => "aliases".to_json(),
+ }
+ }
+}
+
+pub enum LoadTargetError {
+ BuiltinTargetNotFound(String),
+ Other(String),
+}
+
+pub type LinkArgs = BTreeMap<LinkerFlavor, Vec<String>>;
+pub type TargetResult = Result<Target, String>;
+
+macro_rules! supported_targets {
+ ( $(($triple:expr, $module:ident),)+ ) => (
+ $(mod $module;)*
+
+ /// List of supported targets
+ const TARGETS: &[&str] = &[$($triple),*];
+
+ fn load_specific(target: &str) -> Result<Target, LoadTargetError> {
+ match target {
+ $(
+ $triple => {
+ let mut t = $module::target()
+ .map_err(LoadTargetError::Other)?;
+ t.options.is_builtin = true;
+
+ // round-trip through the JSON parser to ensure at
+ // run-time that the parser works correctly
+ t = Target::from_json(t.to_json())
+ .map_err(LoadTargetError::Other)?;
+ debug!("Got builtin target: {:?}", t);
+ Ok(t)
+ },
+ )+
+ _ => Err(LoadTargetError::BuiltinTargetNotFound(
+ format!("Unable to find target: {}", target)))
+ }
+ }
+
+ pub fn get_targets() -> impl Iterator<Item = String> {
+ TARGETS.iter().filter_map(|t| -> Option<String> {
+ load_specific(t)
+ .and(Ok(t.to_string()))
+ .ok()
+ })
+ }
+
+ #[cfg(test)]
+ mod test_json_encode_decode {
+ use serialize::json::ToJson;
+ use super::Target;
+ $(use super::$module;)*
+
+ $(
+ #[test]
+ fn $module() {
+ // Grab the TargetResult struct. If we successfully retrieved
+ // a Target, then the test JSON encoding/decoding can run for this
+ // Target on this testing platform (i.e., checking the iOS targets
+ // only on a Mac test platform).
+ let _ = $module::target().map(|original| {
+ let as_json = original.to_json();
+ let parsed = Target::from_json(as_json).unwrap();
+ assert_eq!(original, parsed);
+ });
+ }
+ )*
+ }
+ )
+}
+
+supported_targets! {
+ ("x86_64-unknown-linux-gnu", x86_64_unknown_linux_gnu),
+ ("x86_64-unknown-linux-gnux32", x86_64_unknown_linux_gnux32),
+ ("i686-unknown-linux-gnu", i686_unknown_linux_gnu),
+ ("i586-unknown-linux-gnu", i586_unknown_linux_gnu),
+ ("mips-unknown-linux-gnu", mips_unknown_linux_gnu),
+ ("mips64-unknown-linux-gnuabi64", mips64_unknown_linux_gnuabi64),
+ ("mips64el-unknown-linux-gnuabi64", mips64el_unknown_linux_gnuabi64),
+ ("mipsel-unknown-linux-gnu", mipsel_unknown_linux_gnu),
+ ("powerpc-unknown-linux-gnu", powerpc_unknown_linux_gnu),
+ ("powerpc-unknown-linux-gnuspe", powerpc_unknown_linux_gnuspe),
+ ("powerpc-unknown-linux-musl", powerpc_unknown_linux_musl),
+ ("powerpc64-unknown-linux-gnu", powerpc64_unknown_linux_gnu),
+ ("powerpc64-unknown-linux-musl", powerpc64_unknown_linux_musl),
+ ("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu),
+ ("powerpc64le-unknown-linux-musl", powerpc64le_unknown_linux_musl),
+ ("s390x-unknown-linux-gnu", s390x_unknown_linux_gnu),
+ ("sparc-unknown-linux-gnu", sparc_unknown_linux_gnu),
+ ("sparc64-unknown-linux-gnu", sparc64_unknown_linux_gnu),
+ ("arm-unknown-linux-gnueabi", arm_unknown_linux_gnueabi),
+ ("arm-unknown-linux-gnueabihf", arm_unknown_linux_gnueabihf),
+ ("arm-unknown-linux-musleabi", arm_unknown_linux_musleabi),
+ ("arm-unknown-linux-musleabihf", arm_unknown_linux_musleabihf),
+ ("armv4t-unknown-linux-gnueabi", armv4t_unknown_linux_gnueabi),
+ ("armv5te-unknown-linux-gnueabi", armv5te_unknown_linux_gnueabi),
+ ("armv5te-unknown-linux-musleabi", armv5te_unknown_linux_musleabi),
+ ("armv7-unknown-linux-gnueabihf", armv7_unknown_linux_gnueabihf),
+ ("thumbv7neon-unknown-linux-gnueabihf", thumbv7neon_unknown_linux_gnueabihf),
+ ("armv7-unknown-linux-musleabihf", armv7_unknown_linux_musleabihf),
+ ("aarch64-unknown-linux-gnu", aarch64_unknown_linux_gnu),
+
+ ("aarch64-unknown-linux-musl", aarch64_unknown_linux_musl),
+ ("x86_64-unknown-linux-musl", x86_64_unknown_linux_musl),
+ ("i686-unknown-linux-musl", i686_unknown_linux_musl),
+ ("i586-unknown-linux-musl", i586_unknown_linux_musl),
+ ("mips-unknown-linux-musl", mips_unknown_linux_musl),
+ ("mipsel-unknown-linux-musl", mipsel_unknown_linux_musl),
+
+ ("mips-unknown-linux-uclibc", mips_unknown_linux_uclibc),
+ ("mipsel-unknown-linux-uclibc", mipsel_unknown_linux_uclibc),
+
+ ("i686-linux-android", i686_linux_android),
+ ("x86_64-linux-android", x86_64_linux_android),
+ ("arm-linux-androideabi", arm_linux_androideabi),
+ ("armv7-linux-androideabi", armv7_linux_androideabi),
+ ("thumbv7neon-linux-androideabi", thumbv7neon_linux_androideabi),
+ ("aarch64-linux-android", aarch64_linux_android),
+
+ ("aarch64-unknown-freebsd", aarch64_unknown_freebsd),
+ ("armv6-unknown-freebsd", armv6_unknown_freebsd),
+ ("armv7-unknown-freebsd", armv7_unknown_freebsd),
+ ("i686-unknown-freebsd", i686_unknown_freebsd),
+ ("powerpc64-unknown-freebsd", powerpc64_unknown_freebsd),
+ ("x86_64-unknown-freebsd", x86_64_unknown_freebsd),
+
+ ("i686-unknown-dragonfly", i686_unknown_dragonfly),
+ ("x86_64-unknown-dragonfly", x86_64_unknown_dragonfly),
+
+ ("x86_64-unknown-bitrig", x86_64_unknown_bitrig),
+
+ ("aarch64-unknown-openbsd", aarch64_unknown_openbsd),
+ ("i686-unknown-openbsd", i686_unknown_openbsd),
+ ("x86_64-unknown-openbsd", x86_64_unknown_openbsd),
+
+ ("aarch64-unknown-netbsd", aarch64_unknown_netbsd),
+ ("armv6-unknown-netbsd-eabihf", armv6_unknown_netbsd_eabihf),
+ ("armv7-unknown-netbsd-eabihf", armv7_unknown_netbsd_eabihf),
+ ("i686-unknown-netbsd", i686_unknown_netbsd),
+ ("powerpc-unknown-netbsd", powerpc_unknown_netbsd),
+ ("sparc64-unknown-netbsd", sparc64_unknown_netbsd),
+ ("x86_64-unknown-netbsd", x86_64_unknown_netbsd),
+ ("x86_64-rumprun-netbsd", x86_64_rumprun_netbsd),
+
+ ("i686-unknown-haiku", i686_unknown_haiku),
+ ("x86_64-unknown-haiku", x86_64_unknown_haiku),
+
+ ("x86_64-apple-darwin", x86_64_apple_darwin),
+ ("i686-apple-darwin", i686_apple_darwin),
+
+ ("aarch64-fuchsia", aarch64_fuchsia),
+ ("x86_64-fuchsia", x86_64_fuchsia),
+
+ ("x86_64-unknown-l4re-uclibc", x86_64_unknown_l4re_uclibc),
+
+ ("x86_64-unknown-redox", x86_64_unknown_redox),
+
+ ("i386-apple-ios", i386_apple_ios),
+ ("x86_64-apple-ios", x86_64_apple_ios),
+ ("aarch64-apple-ios", aarch64_apple_ios),
+ ("armv7-apple-ios", armv7_apple_ios),
+ ("armv7s-apple-ios", armv7s_apple_ios),
+
+ ("armebv7r-none-eabi", armebv7r_none_eabi),
+ ("armebv7r-none-eabihf", armebv7r_none_eabihf),
+ ("armv7r-none-eabi", armv7r_none_eabi),
+ ("armv7r-none-eabihf", armv7r_none_eabihf),
+
+ ("x86_64-sun-solaris", x86_64_sun_solaris),
+ ("sparcv9-sun-solaris", sparcv9_sun_solaris),
+
+ ("x86_64-pc-windows-gnu", x86_64_pc_windows_gnu),
+ ("i686-pc-windows-gnu", i686_pc_windows_gnu),
+
+ ("aarch64-pc-windows-msvc", aarch64_pc_windows_msvc),
+ ("x86_64-pc-windows-msvc", x86_64_pc_windows_msvc),
+ ("i686-pc-windows-msvc", i686_pc_windows_msvc),
+ ("i586-pc-windows-msvc", i586_pc_windows_msvc),
+ ("thumbv7a-pc-windows-msvc", thumbv7a_pc_windows_msvc),
+
+ ("asmjs-unknown-emscripten", asmjs_unknown_emscripten),
+ ("wasm32-unknown-emscripten", wasm32_unknown_emscripten),
+ ("wasm32-unknown-unknown", wasm32_unknown_unknown),
+ ("wasm32-experimental-emscripten", wasm32_experimental_emscripten),
+
+ ("thumbv6m-none-eabi", thumbv6m_none_eabi),
+ ("thumbv7m-none-eabi", thumbv7m_none_eabi),
+ ("thumbv7em-none-eabi", thumbv7em_none_eabi),
+ ("thumbv7em-none-eabihf", thumbv7em_none_eabihf),
+ ("thumbv8m.base-none-eabi", thumbv8m_base_none_eabi),
+ ("thumbv8m.main-none-eabi", thumbv8m_main_none_eabi),
+ ("thumbv8m.main-none-eabihf", thumbv8m_main_none_eabihf),
+
+ ("msp430-none-elf", msp430_none_elf),
+
+ ("aarch64-unknown-cloudabi", aarch64_unknown_cloudabi),
+ ("armv7-unknown-cloudabi-eabihf", armv7_unknown_cloudabi_eabihf),
+ ("i686-unknown-cloudabi", i686_unknown_cloudabi),
+ ("x86_64-unknown-cloudabi", x86_64_unknown_cloudabi),
+
+ ("aarch64-unknown-hermit", aarch64_unknown_hermit),
+ ("x86_64-unknown-hermit", x86_64_unknown_hermit),
+
+ ("riscv32imc-unknown-none-elf", riscv32imc_unknown_none_elf),
+ ("riscv32imac-unknown-none-elf", riscv32imac_unknown_none_elf),
+ ("riscv64imac-unknown-none-elf", riscv64imac_unknown_none_elf),
+ ("riscv64gc-unknown-none-elf", riscv64gc_unknown_none_elf),
+
+ ("aarch64-unknown-none", aarch64_unknown_none),
+
+ ("x86_64-fortanix-unknown-sgx", x86_64_fortanix_unknown_sgx),
+
+ ("x86_64-unknown-uefi", x86_64_unknown_uefi),
+
+ ("nvptx64-nvidia-cuda", nvptx64_nvidia_cuda),
+}
+
+/// Everything `rustc` knows about how to compile for a specific target.
+///
+/// Every field here must be specified, and has no default value.
+#[derive(PartialEq, Clone, Debug)]
+pub struct Target {
+ /// Target triple to pass to LLVM.
+ pub llvm_target: String,
+ /// String to use as the `target_endian` `cfg` variable.
+ pub target_endian: String,
+ /// String to use as the `target_pointer_width` `cfg` variable.
+ pub target_pointer_width: String,
+ /// Width of c_int type
+ pub target_c_int_width: String,
+ /// OS name to use for conditional compilation.
+ pub target_os: String,
+ /// Environment name to use for conditional compilation.
+ pub target_env: String,
+ /// Vendor name to use for conditional compilation.
+ pub target_vendor: String,
+ /// Architecture to use for ABI considerations. Valid options: "x86",
+ /// "x86_64", "arm", "aarch64", "mips", "powerpc", and "powerpc64".
+ pub arch: String,
+ /// [Data layout](http://llvm.org/docs/LangRef.html#data-layout) to pass to LLVM.
+ pub data_layout: String,
+ /// Linker flavor
+ pub linker_flavor: LinkerFlavor,
+ /// Optional settings with defaults.
+ pub options: TargetOptions,
+}
+
+pub trait HasTargetSpec {
+ fn target_spec(&self) -> &Target;
+}
+
+impl HasTargetSpec for Target {
+ fn target_spec(&self) -> &Target {
+ self
+ }
+}
+
+/// Optional aspects of a target specification.
+///
+/// This has an implementation of `Default`, see each field for what the default is. In general,
+/// these try to take "minimal defaults" that don't assume anything about the runtime they run in.
+#[derive(PartialEq, Clone, Debug)]
+pub struct TargetOptions {
+ /// Whether the target is built-in or loaded from a custom target specification.
+ pub is_builtin: bool,
+
+ /// Linker to invoke
+ pub linker: Option<String>,
+
+ /// LLD flavor
+ pub lld_flavor: LldFlavor,
+
+ /// Linker arguments that are passed *before* any user-defined libraries.
+ pub pre_link_args: LinkArgs, // ... unconditionally
+ pub pre_link_args_crt: LinkArgs, // ... when linking with a bundled crt
+ /// Objects to link before all others, always found within the
+ /// sysroot folder.
+ pub pre_link_objects_exe: Vec<String>, // ... when linking an executable, unconditionally
+ pub pre_link_objects_exe_crt: Vec<String>, // ... when linking an executable with a bundled crt
+ pub pre_link_objects_dll: Vec<String>, // ... when linking a dylib
+ /// Linker arguments that are unconditionally passed after any
+ /// user-defined but before post_link_objects. Standard platform
+ /// libraries that should be always be linked to, usually go here.
+ pub late_link_args: LinkArgs,
+ /// Objects to link after all others, always found within the
+ /// sysroot folder.
+ pub post_link_objects: Vec<String>, // ... unconditionally
+ pub post_link_objects_crt: Vec<String>, // ... when linking with a bundled crt
+ /// Linker arguments that are unconditionally passed *after* any
+ /// user-defined libraries.
+ pub post_link_args: LinkArgs,
+
+ /// Environment variables to be set before invoking the linker.
+ pub link_env: Vec<(String, String)>,
+
+ /// Extra arguments to pass to the external assembler (when used)
+ pub asm_args: Vec<String>,
+
+ /// Default CPU to pass to LLVM. Corresponds to `llc -mcpu=$cpu`. Defaults
+ /// to "generic".
+ pub cpu: String,
+ /// Default target features to pass to LLVM. These features will *always* be
+ /// passed, and cannot be disabled even via `-C`. Corresponds to `llc
+ /// -mattr=$features`.
+ pub features: String,
+ /// Whether dynamic linking is available on this target. Defaults to false.
+ pub dynamic_linking: bool,
+ /// If dynamic linking is available, whether only cdylibs are supported.
+ pub only_cdylib: bool,
+ /// Whether executables are available on this target. iOS, for example, only allows static
+ /// libraries. Defaults to false.
+ pub executables: bool,
+ /// Relocation model to use in object file. Corresponds to `llc
+ /// -relocation-model=$relocation_model`. Defaults to "pic".
+ pub relocation_model: String,
+ /// Code model to use. Corresponds to `llc -code-model=$code_model`.
+ pub code_model: Option<String>,
+ /// TLS model to use. Options are "global-dynamic" (default), "local-dynamic", "initial-exec"
+ /// and "local-exec". This is similar to the -ftls-model option in GCC/Clang.
+ pub tls_model: String,
+ /// Do not emit code that uses the "red zone", if the ABI has one. Defaults to false.
+ pub disable_redzone: bool,
+ /// Eliminate frame pointers from stack frames if possible. Defaults to true.
+ pub eliminate_frame_pointer: bool,
+ /// Emit each function in its own section. Defaults to true.
+ pub function_sections: bool,
+ /// String to prepend to the name of every dynamic library. Defaults to "lib".
+ pub dll_prefix: String,
+ /// String to append to the name of every dynamic library. Defaults to ".so".
+ pub dll_suffix: String,
+ /// String to append to the name of every executable.
+ pub exe_suffix: String,
+ /// String to prepend to the name of every static library. Defaults to "lib".
+ pub staticlib_prefix: String,
+ /// String to append to the name of every static library. Defaults to ".a".
+ pub staticlib_suffix: String,
+ /// OS family to use for conditional compilation. Valid options: "unix", "windows".
+ pub target_family: Option<String>,
+ /// Whether the target toolchain's ABI supports returning small structs as an integer.
+ pub abi_return_struct_as_int: bool,
+ /// Whether the target toolchain is like macOS's. Only useful for compiling against iOS/macOS,
+ /// in particular running dsymutil and some other stuff like `-dead_strip`. Defaults to false.
+ pub is_like_osx: bool,
+ /// Whether the target toolchain is like Solaris's.
+ /// Only useful for compiling against Illumos/Solaris,
+ /// as they have a different set of linker flags. Defaults to false.
+ pub is_like_solaris: bool,
+ /// Whether the target toolchain is like Windows'. Only useful for compiling against Windows,
+ /// only really used for figuring out how to find libraries, since Windows uses its own
+ /// library naming convention. Defaults to false.
+ pub is_like_windows: bool,
+ pub is_like_msvc: bool,
+ /// Whether the target toolchain is like Android's. Only useful for compiling against Android.
+ /// Defaults to false.
+ pub is_like_android: bool,
+ /// Whether the target toolchain is like Emscripten's. Only useful for compiling with
+ /// Emscripten toolchain.
+ /// Defaults to false.
+ pub is_like_emscripten: bool,
+ /// Whether the target toolchain is like Fuchsia's.
+ pub is_like_fuchsia: bool,
+ /// Whether the linker support GNU-like arguments such as -O. Defaults to false.
+ pub linker_is_gnu: bool,
+ /// The MinGW toolchain has a known issue that prevents it from correctly
+ /// handling COFF object files with more than 2<sup>15</sup> sections. Since each weak
+ /// symbol needs its own COMDAT section, weak linkage implies a large
+ /// number sections that easily exceeds the given limit for larger
+ /// codebases. Consequently we want a way to disallow weak linkage on some
+ /// platforms.
+ pub allows_weak_linkage: bool,
+ /// Whether the linker support rpaths or not. Defaults to false.
+ pub has_rpath: bool,
+ /// Whether to disable linking to the default libraries, typically corresponds
+ /// to `-nodefaultlibs`. Defaults to true.
+ pub no_default_libraries: bool,
+ /// Dynamically linked executables can be compiled as position independent
+ /// if the default relocation model of position independent code is not
+ /// changed. This is a requirement to take advantage of ASLR, as otherwise
+ /// the functions in the executable are not randomized and can be used
+ /// during an exploit of a vulnerability in any code.
+ pub position_independent_executables: bool,
+ /// Determines if the target always requires using the PLT for indirect
+ /// library calls or not. This controls the default value of the `-Z plt` flag.
+ pub needs_plt: bool,
+ /// Either partial, full, or off. Full RELRO makes the dynamic linker
+ /// resolve all symbols at startup and marks the GOT read-only before
+ /// starting the program, preventing overwriting the GOT.
+ pub relro_level: RelroLevel,
+ /// Format that archives should be emitted in. This affects whether we use
+ /// LLVM to assemble an archive or fall back to the system linker, and
+ /// currently only "gnu" is used to fall into LLVM. Unknown strings cause
+ /// the system linker to be used.
+ pub archive_format: String,
+ /// Is asm!() allowed? Defaults to true.
+ pub allow_asm: bool,
+ /// Whether the target uses a custom unwind resumption routine.
+ /// By default LLVM lowers `resume` instructions into calls to `_Unwind_Resume`
+ /// defined in libgcc. If this option is enabled, the target must provide
+ /// `eh_unwind_resume` lang item.
+ pub custom_unwind_resume: bool,
+
+ /// Flag indicating whether ELF TLS (e.g., #[thread_local]) is available for
+ /// this target.
+ pub has_elf_tls: bool,
+ // This is mainly for easy compatibility with emscripten.
+ // If we give emcc .o files that are actually .bc files it
+ // will 'just work'.
+ pub obj_is_bitcode: bool,
+
+ // LLVM can't produce object files for this target. Instead, we'll make LLVM
+ // emit assembly and then use `gcc` to turn that assembly into an object
+ // file
+ pub no_integrated_as: bool,
+
+ /// Don't use this field; instead use the `.min_atomic_width()` method.
+ pub min_atomic_width: Option<u64>,
+
+ /// Don't use this field; instead use the `.max_atomic_width()` method.
+ pub max_atomic_width: Option<u64>,
+
+ /// Whether the target supports atomic CAS operations natively
+ pub atomic_cas: bool,
+
+ /// Panic strategy: "unwind" or "abort"
+ pub panic_strategy: PanicStrategy,
+
+ /// A blacklist of ABIs unsupported by the current target. Note that generic
+ /// ABIs are considered to be supported on all platforms and cannot be blacklisted.
+ pub abi_blacklist: Vec<Abi>,
+
+ /// Whether or not linking dylibs to a static CRT is allowed.
+ pub crt_static_allows_dylibs: bool,
+ /// Whether or not the CRT is statically linked by default.
+ pub crt_static_default: bool,
+ /// Whether or not crt-static is respected by the compiler (or is a no-op).
+ pub crt_static_respected: bool,
+
+ /// Whether or not stack probes (__rust_probestack) are enabled
+ pub stack_probes: bool,
+
+ /// The minimum alignment for global symbols.
+ pub min_global_align: Option<u64>,
+
+ /// Default number of codegen units to use in debug mode
+ pub default_codegen_units: Option<u64>,
+
+ /// Whether to generate trap instructions in places where optimization would
+ /// otherwise produce control flow that falls through into unrelated memory.
+ pub trap_unreachable: bool,
+
+ /// This target requires everything to be compiled with LTO to emit a final
+ /// executable, aka there is no native linker for this target.
+ pub requires_lto: bool,
+
+ /// This target has no support for threads.
+ pub singlethread: bool,
+
+ /// Whether library functions call lowering/optimization is disabled in LLVM
+ /// for this target unconditionally.
+ pub no_builtins: bool,
+
+ /// Whether to lower 128-bit operations to compiler_builtins calls. Use if
+ /// your backend only supports 64-bit and smaller math.
+ pub i128_lowering: bool,
+
+ /// The codegen backend to use for this target, typically "llvm"
+ pub codegen_backend: String,
+
+ /// The default visibility for symbols in this target should be "hidden"
+ /// rather than "default"
+ pub default_hidden_visibility: bool,
+
+ /// Whether or not bitcode is embedded in object files
+ pub embed_bitcode: bool,
+
+ /// Whether a .debug_gdb_scripts section will be added to the output object file
+ pub emit_debug_gdb_scripts: bool,
+
+ /// Whether or not to unconditionally `uwtable` attributes on functions,
+ /// typically because the platform needs to unwind for things like stack
+ /// unwinders.
+ pub requires_uwtable: bool,
+
+ /// Whether or not SIMD types are passed by reference in the Rust ABI,
+ /// typically required if a target can be compiled with a mixed set of
+ /// target features. This is `true` by default, and `false` for targets like
+ /// wasm32 where the whole program either has simd or not.
+ pub simd_types_indirect: bool,
+
+ /// If set, have the linker export exactly these symbols, instead of using
+ /// the usual logic to figure this out from the crate itself.
+ pub override_export_symbols: Option<Vec<String>>,
+
+ /// Determines how or whether the MergeFunctions LLVM pass should run for
+ /// this target. Either "disabled", "trampolines", or "aliases".
+ /// The MergeFunctions pass is generally useful, but some targets may need
+ /// to opt out. The default is "aliases".
+ ///
+ /// Workaround for: https://github.com/rust-lang/rust/issues/57356
+ pub merge_functions: MergeFunctions
+}
+
+impl Default for TargetOptions {
+ /// Creates a set of "sane defaults" for any target. This is still
+ /// incomplete, and if used for compilation, will certainly not work.
+ fn default() -> TargetOptions {
+ TargetOptions {
+ is_builtin: false,
+ linker: option_env!("CFG_DEFAULT_LINKER").map(|s| s.to_string()),
+ lld_flavor: LldFlavor::Ld,
+ pre_link_args: LinkArgs::new(),
+ pre_link_args_crt: LinkArgs::new(),
+ post_link_args: LinkArgs::new(),
+ asm_args: Vec::new(),
+ cpu: "generic".to_string(),
+ features: String::new(),
+ dynamic_linking: false,
+ only_cdylib: false,
+ executables: false,
+ relocation_model: "pic".to_string(),
+ code_model: None,
+ tls_model: "global-dynamic".to_string(),
+ disable_redzone: false,
+ eliminate_frame_pointer: true,
+ function_sections: true,
+ dll_prefix: "lib".to_string(),
+ dll_suffix: ".so".to_string(),
+ exe_suffix: String::new(),
+ staticlib_prefix: "lib".to_string(),
+ staticlib_suffix: ".a".to_string(),
+ target_family: None,
+ abi_return_struct_as_int: false,
+ is_like_osx: false,
+ is_like_solaris: false,
+ is_like_windows: false,
+ is_like_android: false,
+ is_like_emscripten: false,
+ is_like_msvc: false,
+ is_like_fuchsia: false,
+ linker_is_gnu: false,
+ allows_weak_linkage: true,
+ has_rpath: false,
+ no_default_libraries: true,
+ position_independent_executables: false,
+ needs_plt: false,
+ relro_level: RelroLevel::None,
+ pre_link_objects_exe: Vec::new(),
+ pre_link_objects_exe_crt: Vec::new(),
+ pre_link_objects_dll: Vec::new(),
+ post_link_objects: Vec::new(),
+ post_link_objects_crt: Vec::new(),
+ late_link_args: LinkArgs::new(),
+ link_env: Vec::new(),
+ archive_format: "gnu".to_string(),
+ custom_unwind_resume: false,
+ allow_asm: true,
+ has_elf_tls: false,
+ obj_is_bitcode: false,
+ no_integrated_as: false,
+ min_atomic_width: None,
+ max_atomic_width: None,
+ atomic_cas: true,
+ panic_strategy: PanicStrategy::Unwind,
+ abi_blacklist: vec![],
+ crt_static_allows_dylibs: false,
+ crt_static_default: false,
+ crt_static_respected: false,
+ stack_probes: false,
+ min_global_align: None,
+ default_codegen_units: None,
+ trap_unreachable: true,
+ requires_lto: false,
+ singlethread: false,
+ no_builtins: false,
+ i128_lowering: false,
+ codegen_backend: "llvm".to_string(),
+ default_hidden_visibility: false,
+ embed_bitcode: false,
+ emit_debug_gdb_scripts: true,
+ requires_uwtable: false,
+ simd_types_indirect: true,
+ override_export_symbols: None,
+ merge_functions: MergeFunctions::Aliases,
+ }
+ }
+}
+
+impl Target {
+ /// Given a function ABI, turn it into the correct ABI for this target.
+ pub fn adjust_abi(&self, abi: Abi) -> Abi {
+ match abi {
+ Abi::System => {
+ if self.options.is_like_windows && self.arch == "x86" {
+ Abi::Stdcall
+ } else {
+ Abi::C
+ }
+ },
+ // These ABI kinds are ignored on non-x86 Windows targets.
+ // See https://docs.microsoft.com/en-us/cpp/cpp/argument-passing-and-naming-conventions
+ // and the individual pages for __stdcall et al.
+ Abi::Stdcall | Abi::Fastcall | Abi::Vectorcall | Abi::Thiscall => {
+ if self.options.is_like_windows && self.arch != "x86" {
+ Abi::C
+ } else {
+ abi
+ }
+ },
+ abi => abi
+ }
+ }
+
+ /// Minimum integer size in bits that this target can perform atomic
+ /// operations on.
+ pub fn min_atomic_width(&self) -> u64 {
+ self.options.min_atomic_width.unwrap_or(8)
+ }
+
+ /// Maximum integer size in bits that this target can perform atomic
+ /// operations on.
+ pub fn max_atomic_width(&self) -> u64 {
+ self.options.max_atomic_width.unwrap_or_else(|| self.target_pointer_width.parse().unwrap())
+ }
+
+ pub fn is_abi_supported(&self, abi: Abi) -> bool {
+ abi.generic() || !self.options.abi_blacklist.contains(&abi)
+ }
+
+ /// Loads a target descriptor from a JSON object.
+ pub fn from_json(obj: Json) -> TargetResult {
+ // While ugly, this code must remain this way to retain
+ // compatibility with existing JSON fields and the internal
+ // expected naming of the Target and TargetOptions structs.
+ // To ensure compatibility is retained, the built-in targets
+ // are round-tripped through this code to catch cases where
+ // the JSON parser is not updated to match the structs.
+
+ let get_req_field = |name: &str| {
+ obj.find(name)
+ .map(|s| s.as_string())
+ .and_then(|os| os.map(|s| s.to_string()))
+ .ok_or_else(|| format!("Field {} in target specification is required", name))
+ };
+
+ let get_opt_field = |name: &str, default: &str| {
+ obj.find(name).and_then(|s| s.as_string())
+ .map(|s| s.to_string())
+ .unwrap_or_else(|| default.to_string())
+ };
+
+ let mut base = Target {
+ llvm_target: get_req_field("llvm-target")?,
+ target_endian: get_req_field("target-endian")?,
+ target_pointer_width: get_req_field("target-pointer-width")?,
+ target_c_int_width: get_req_field("target-c-int-width")?,
+ data_layout: get_req_field("data-layout")?,
+ arch: get_req_field("arch")?,
+ target_os: get_req_field("os")?,
+ target_env: get_opt_field("env", ""),
+ target_vendor: get_opt_field("vendor", "unknown"),
+ linker_flavor: LinkerFlavor::from_str(&*get_req_field("linker-flavor")?)
+ .ok_or_else(|| {
+ format!("linker flavor must be {}", LinkerFlavor::one_of())
+ })?,
+ options: Default::default(),
+ };
+
+ macro_rules! key {
+ ($key_name:ident) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ obj.find(&name[..]).map(|o| o.as_string()
+ .map(|s| base.options.$key_name = s.to_string()));
+ } );
+ ($key_name:ident, bool) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ obj.find(&name[..])
+ .map(|o| o.as_boolean()
+ .map(|s| base.options.$key_name = s));
+ } );
+ ($key_name:ident, Option<u64>) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ obj.find(&name[..])
+ .map(|o| o.as_u64()
+ .map(|s| base.options.$key_name = Some(s)));
+ } );
+ ($key_name:ident, MergeFunctions) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ obj.find(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+ match s.parse::<MergeFunctions>() {
+ Ok(mergefunc) => base.options.$key_name = mergefunc,
+ _ => return Some(Err(format!("'{}' is not a valid value for \
+ merge-functions. Use 'disabled', \
+ 'trampolines', or 'aliases'.",
+ s))),
+ }
+ Some(Ok(()))
+ })).unwrap_or(Ok(()))
+ } );
+ ($key_name:ident, PanicStrategy) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ obj.find(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+ match s {
+ "unwind" => base.options.$key_name = PanicStrategy::Unwind,
+ "abort" => base.options.$key_name = PanicStrategy::Abort,
+ _ => return Some(Err(format!("'{}' is not a valid value for \
+ panic-strategy. Use 'unwind' or 'abort'.",
+ s))),
+ }
+ Some(Ok(()))
+ })).unwrap_or(Ok(()))
+ } );
+ ($key_name:ident, RelroLevel) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ obj.find(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+ match s.parse::<RelroLevel>() {
+ Ok(level) => base.options.$key_name = level,
+ _ => return Some(Err(format!("'{}' is not a valid value for \
+ relro-level. Use 'full', 'partial, or 'off'.",
+ s))),
+ }
+ Some(Ok(()))
+ })).unwrap_or(Ok(()))
+ } );
+ ($key_name:ident, list) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ obj.find(&name[..]).map(|o| o.as_array()
+ .map(|v| base.options.$key_name = v.iter()
+ .map(|a| a.as_string().unwrap().to_string()).collect()
+ )
+ );
+ } );
+ ($key_name:ident, opt_list) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ obj.find(&name[..]).map(|o| o.as_array()
+ .map(|v| base.options.$key_name = Some(v.iter()
+ .map(|a| a.as_string().unwrap().to_string()).collect())
+ )
+ );
+ } );
+ ($key_name:ident, optional) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ if let Some(o) = obj.find(&name[..]) {
+ base.options.$key_name = o
+ .as_string()
+ .map(|s| s.to_string() );
+ }
+ } );
+ ($key_name:ident, LldFlavor) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ obj.find(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+ if let Some(flavor) = LldFlavor::from_str(&s) {
+ base.options.$key_name = flavor;
+ } else {
+ return Some(Err(format!(
+ "'{}' is not a valid value for lld-flavor. \
+ Use 'darwin', 'gnu', 'link' or 'wasm.",
+ s)))
+ }
+ Some(Ok(()))
+ })).unwrap_or(Ok(()))
+ } );
+ ($key_name:ident, LinkerFlavor) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ obj.find(&name[..]).and_then(|o| o.as_string().map(|s| {
+ LinkerFlavor::from_str(&s).ok_or_else(|| {
+ Err(format!("'{}' is not a valid value for linker-flavor. \
+ Use 'em', 'gcc', 'ld' or 'msvc.", s))
+ })
+ })).unwrap_or(Ok(()))
+ } );
+ ($key_name:ident, link_args) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ if let Some(val) = obj.find(&name[..]) {
+ let obj = val.as_object().ok_or_else(|| format!("{}: expected a \
+ JSON object with fields per linker-flavor.", name))?;
+ let mut args = LinkArgs::new();
+ for (k, v) in obj {
+ let flavor = LinkerFlavor::from_str(&k).ok_or_else(|| {
+ format!("{}: '{}' is not a valid value for linker-flavor. \
+ Use 'em', 'gcc', 'ld' or 'msvc'", name, k)
+ })?;
+
+ let v = v.as_array().ok_or_else(||
+ format!("{}.{}: expected a JSON array", name, k)
+ )?.iter().enumerate()
+ .map(|(i,s)| {
+ let s = s.as_string().ok_or_else(||
+ format!("{}.{}[{}]: expected a JSON string", name, k, i))?;
+ Ok(s.to_owned())
+ })
+ .collect::<Result<Vec<_>, String>>()?;
+
+ args.insert(flavor, v);
+ }
+ base.options.$key_name = args;
+ }
+ } );
+ ($key_name:ident, env) => ( {
+ let name = (stringify!($key_name)).replace("_", "-");
+ if let Some(a) = obj.find(&name[..]).and_then(|o| o.as_array()) {
+ for o in a {
+ if let Some(s) = o.as_string() {
+ let p = s.split('=').collect::<Vec<_>>();
+ if p.len() == 2 {
+ let k = p[0].to_string();
+ let v = p[1].to_string();
+ base.options.$key_name.push((k, v));
+ }
+ }
+ }
+ }
+ } );
+ }
+
+ key!(is_builtin, bool);
+ key!(linker, optional);
+ key!(lld_flavor, LldFlavor)?;
+ key!(pre_link_args, link_args);
+ key!(pre_link_args_crt, link_args);
+ key!(pre_link_objects_exe, list);
+ key!(pre_link_objects_exe_crt, list);
+ key!(pre_link_objects_dll, list);
+ key!(late_link_args, link_args);
+ key!(post_link_objects, list);
+ key!(post_link_objects_crt, list);
+ key!(post_link_args, link_args);
+ key!(link_env, env);
+ key!(asm_args, list);
+ key!(cpu);
+ key!(features);
+ key!(dynamic_linking, bool);
+ key!(only_cdylib, bool);
+ key!(executables, bool);
+ key!(relocation_model);
+ key!(code_model, optional);
+ key!(tls_model);
+ key!(disable_redzone, bool);
+ key!(eliminate_frame_pointer, bool);
+ key!(function_sections, bool);
+ key!(dll_prefix);
+ key!(dll_suffix);
+ key!(exe_suffix);
+ key!(staticlib_prefix);
+ key!(staticlib_suffix);
+ key!(target_family, optional);
+ key!(abi_return_struct_as_int, bool);
+ key!(is_like_osx, bool);
+ key!(is_like_solaris, bool);
+ key!(is_like_windows, bool);
+ key!(is_like_msvc, bool);
+ key!(is_like_emscripten, bool);
+ key!(is_like_android, bool);
+ key!(is_like_fuchsia, bool);
+ key!(linker_is_gnu, bool);
+ key!(allows_weak_linkage, bool);
+ key!(has_rpath, bool);
+ key!(no_default_libraries, bool);
+ key!(position_independent_executables, bool);
+ key!(needs_plt, bool);
+ key!(relro_level, RelroLevel)?;
+ key!(archive_format);
+ key!(allow_asm, bool);
+ key!(custom_unwind_resume, bool);
+ key!(has_elf_tls, bool);
+ key!(obj_is_bitcode, bool);
+ key!(no_integrated_as, bool);
+ key!(max_atomic_width, Option<u64>);
+ key!(min_atomic_width, Option<u64>);
+ key!(atomic_cas, bool);
+ key!(panic_strategy, PanicStrategy)?;
+ key!(crt_static_allows_dylibs, bool);
+ key!(crt_static_default, bool);
+ key!(crt_static_respected, bool);
+ key!(stack_probes, bool);
+ key!(min_global_align, Option<u64>);
+ key!(default_codegen_units, Option<u64>);
+ key!(trap_unreachable, bool);
+ key!(requires_lto, bool);
+ key!(singlethread, bool);
+ key!(no_builtins, bool);
+ key!(codegen_backend);
+ key!(default_hidden_visibility, bool);
+ key!(embed_bitcode, bool);
+ key!(emit_debug_gdb_scripts, bool);
+ key!(requires_uwtable, bool);
+ key!(simd_types_indirect, bool);
+ key!(override_export_symbols, opt_list);
+ key!(merge_functions, MergeFunctions)?;
+
+ if let Some(array) = obj.find("abi-blacklist").and_then(Json::as_array) {
+ for name in array.iter().filter_map(|abi| abi.as_string()) {
+ match lookup_abi(name) {
+ Some(abi) => {
+ if abi.generic() {
+ return Err(format!("The ABI \"{}\" is considered to be supported on \
+ all targets and cannot be blacklisted", abi))
+ }
+
+ base.options.abi_blacklist.push(abi)
+ }
+ None => return Err(format!("Unknown ABI \"{}\" in target specification", name))
+ }
+ }
+ }
+
+ Ok(base)
+ }
+
+ /// Search RUST_TARGET_PATH for a JSON file specifying the given target
+ /// triple. Note that it could also just be a bare filename already, so also
+ /// check for that. If one of the hardcoded targets we know about, just
+ /// return it directly.
+ ///
+ /// The error string could come from any of the APIs called, including
+ /// filesystem access and JSON decoding.
+ pub fn search(target_triple: &TargetTriple) -> Result<Target, String> {
+ use std::env;
+ use std::fs;
+ use serialize::json;
+
+ fn load_file(path: &Path) -> Result<Target, String> {
+ let contents = fs::read(path).map_err(|e| e.to_string())?;
+ let obj = json::from_reader(&mut &contents[..])
+ .map_err(|e| e.to_string())?;
+ Target::from_json(obj)
+ }
+
+ match *target_triple {
+ TargetTriple::TargetTriple(ref target_triple) => {
+ // check if triple is in list of supported targets
+ match load_specific(target_triple) {
+ Ok(t) => return Ok(t),
+ Err(LoadTargetError::BuiltinTargetNotFound(_)) => (),
+ Err(LoadTargetError::Other(e)) => return Err(e),
+ }
+
+ // search for a file named `target_triple`.json in RUST_TARGET_PATH
+ let path = {
+ let mut target = target_triple.to_string();
+ target.push_str(".json");
+ PathBuf::from(target)
+ };
+
+ let target_path = env::var_os("RUST_TARGET_PATH").unwrap_or_default();
+
+ // FIXME 16351: add a sane default search path?
+
+ for dir in env::split_paths(&target_path) {
+ let p = dir.join(&path);
+ if p.is_file() {
+ return load_file(&p);
+ }
+ }
+ Err(format!("Could not find specification for target {:?}", target_triple))
+ }
+ TargetTriple::TargetPath(ref target_path) => {
+ if target_path.is_file() {
+ return load_file(&target_path);
+ }
+ Err(format!("Target path {:?} is not a valid file", target_path))
+ }
+ }
+ }
+}
+
+impl ToJson for Target {
+ fn to_json(&self) -> Json {
+ let mut d = BTreeMap::new();
+ let default: TargetOptions = Default::default();
+
+ macro_rules! target_val {
+ ($attr:ident) => ( {
+ let name = (stringify!($attr)).replace("_", "-");
+ d.insert(name, self.$attr.to_json());
+ } );
+ ($attr:ident, $key_name:expr) => ( {
+ let name = $key_name;
+ d.insert(name.to_string(), self.$attr.to_json());
+ } );
+ }
+
+ macro_rules! target_option_val {
+ ($attr:ident) => ( {
+ let name = (stringify!($attr)).replace("_", "-");
+ if default.$attr != self.options.$attr {
+ d.insert(name, self.options.$attr.to_json());
+ }
+ } );
+ ($attr:ident, $key_name:expr) => ( {
+ let name = $key_name;
+ if default.$attr != self.options.$attr {
+ d.insert(name.to_string(), self.options.$attr.to_json());
+ }
+ } );
+ (link_args - $attr:ident) => ( {
+ let name = (stringify!($attr)).replace("_", "-");
+ if default.$attr != self.options.$attr {
+ let obj = self.options.$attr
+ .iter()
+ .map(|(k, v)| (k.desc().to_owned(), v.clone()))
+ .collect::<BTreeMap<_, _>>();
+ d.insert(name, obj.to_json());
+ }
+ } );
+ (env - $attr:ident) => ( {
+ let name = (stringify!($attr)).replace("_", "-");
+ if default.$attr != self.options.$attr {
+ let obj = self.options.$attr
+ .iter()
+ .map(|&(ref k, ref v)| k.clone() + "=" + &v)
+ .collect::<Vec<_>>();
+ d.insert(name, obj.to_json());
+ }
+ } );
+
+ }
+
+ target_val!(llvm_target);
+ target_val!(target_endian);
+ target_val!(target_pointer_width);
+ target_val!(target_c_int_width);
+ target_val!(arch);
+ target_val!(target_os, "os");
+ target_val!(target_env, "env");
+ target_val!(target_vendor, "vendor");
+ target_val!(data_layout);
+ target_val!(linker_flavor);
+
+ target_option_val!(is_builtin);
+ target_option_val!(linker);
+ target_option_val!(lld_flavor);
+ target_option_val!(link_args - pre_link_args);
+ target_option_val!(link_args - pre_link_args_crt);
+ target_option_val!(pre_link_objects_exe);
+ target_option_val!(pre_link_objects_exe_crt);
+ target_option_val!(pre_link_objects_dll);
+ target_option_val!(link_args - late_link_args);
+ target_option_val!(post_link_objects);
+ target_option_val!(post_link_objects_crt);
+ target_option_val!(link_args - post_link_args);
+ target_option_val!(env - link_env);
+ target_option_val!(asm_args);
+ target_option_val!(cpu);
+ target_option_val!(features);
+ target_option_val!(dynamic_linking);
+ target_option_val!(only_cdylib);
+ target_option_val!(executables);
+ target_option_val!(relocation_model);
+ target_option_val!(code_model);
+ target_option_val!(tls_model);
+ target_option_val!(disable_redzone);
+ target_option_val!(eliminate_frame_pointer);
+ target_option_val!(function_sections);
+ target_option_val!(dll_prefix);
+ target_option_val!(dll_suffix);
+ target_option_val!(exe_suffix);
+ target_option_val!(staticlib_prefix);
+ target_option_val!(staticlib_suffix);
+ target_option_val!(target_family);
+ target_option_val!(abi_return_struct_as_int);
+ target_option_val!(is_like_osx);
+ target_option_val!(is_like_solaris);
+ target_option_val!(is_like_windows);
+ target_option_val!(is_like_msvc);
+ target_option_val!(is_like_emscripten);
+ target_option_val!(is_like_android);
+ target_option_val!(is_like_fuchsia);
+ target_option_val!(linker_is_gnu);
+ target_option_val!(allows_weak_linkage);
+ target_option_val!(has_rpath);
+ target_option_val!(no_default_libraries);
+ target_option_val!(position_independent_executables);
+ target_option_val!(needs_plt);
+ target_option_val!(relro_level);
+ target_option_val!(archive_format);
+ target_option_val!(allow_asm);
+ target_option_val!(custom_unwind_resume);
+ target_option_val!(has_elf_tls);
+ target_option_val!(obj_is_bitcode);
+ target_option_val!(no_integrated_as);
+ target_option_val!(min_atomic_width);
+ target_option_val!(max_atomic_width);
+ target_option_val!(atomic_cas);
+ target_option_val!(panic_strategy);
+ target_option_val!(crt_static_allows_dylibs);
+ target_option_val!(crt_static_default);
+ target_option_val!(crt_static_respected);
+ target_option_val!(stack_probes);
+ target_option_val!(min_global_align);
+ target_option_val!(default_codegen_units);
+ target_option_val!(trap_unreachable);
+ target_option_val!(requires_lto);
+ target_option_val!(singlethread);
+ target_option_val!(no_builtins);
+ target_option_val!(codegen_backend);
+ target_option_val!(default_hidden_visibility);
+ target_option_val!(embed_bitcode);
+ target_option_val!(emit_debug_gdb_scripts);
+ target_option_val!(requires_uwtable);
+ target_option_val!(simd_types_indirect);
+ target_option_val!(override_export_symbols);
+ target_option_val!(merge_functions);
+
+ if default.abi_blacklist != self.options.abi_blacklist {
+ d.insert("abi-blacklist".to_string(), self.options.abi_blacklist.iter()
+ .map(|&name| Abi::name(name).to_json())
+ .collect::<Vec<_>>().to_json());
+ }
+
+ Json::Object(d)
+ }
+}
+
+/// Either a target triple string or a path to a JSON file.
+#[derive(PartialEq, Clone, Debug, Hash, RustcEncodable, RustcDecodable)]
+pub enum TargetTriple {
+ TargetTriple(String),
+ TargetPath(PathBuf),
+}
+
+impl TargetTriple {
+ /// Creates a target triple from the passed target triple string.
+ pub fn from_triple(triple: &str) -> Self {
+ TargetTriple::TargetTriple(triple.to_string())
+ }
+
+ /// Creates a target triple from the passed target path.
+ pub fn from_path(path: &Path) -> Result<Self, io::Error> {
+ let canonicalized_path = path.canonicalize()?;
+ Ok(TargetTriple::TargetPath(canonicalized_path))
+ }
+
+ /// Returns a string triple for this target.
+ ///
+ /// If this target is a path, the file name (without extension) is returned.
+ pub fn triple(&self) -> &str {
+ match *self {
+ TargetTriple::TargetTriple(ref triple) => triple,
+ TargetTriple::TargetPath(ref path) => {
+ path.file_stem().expect("target path must not be empty").to_str()
+ .expect("target path must be valid unicode")
+ }
+ }
+ }
+
+ /// Returns an extended string triple for this target.
+ ///
+ /// If this target is a path, a hash of the path is appended to the triple returned
+ /// by `triple()`.
+ pub fn debug_triple(&self) -> String {
+ use std::hash::{Hash, Hasher};
+ use std::collections::hash_map::DefaultHasher;
+
+ let triple = self.triple();
+ if let TargetTriple::TargetPath(ref path) = *self {
+ let mut hasher = DefaultHasher::new();
+ path.hash(&mut hasher);
+ let hash = hasher.finish();
+ format!("{}-{}", triple, hash)
+ } else {
+ triple.to_owned()
+ }
+ }
+}
+
+impl fmt::Display for TargetTriple {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "{}", self.debug_triple())
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/msp430_none_elf.rs b/vendor/rustc-ap-rustc_target/spec/msp430_none_elf.rs
new file mode 100644
index 0000000..90af589
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/msp430_none_elf.rs
@@ -0,0 +1,63 @@
+use crate::spec::{LinkerFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "msp430-none-elf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "16".to_string(),
+ target_c_int_width: "16".to_string(),
+ data_layout: "e-m:e-p:16:16-i32:16-i64:16-f32:16-f64:16-a:8-n8:16-S16".to_string(),
+ arch: "msp430".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: String::new(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ executables: true,
+
+ // The LLVM backend currently can't generate object files. To
+ // workaround this LLVM generates assembly files which then we feed
+ // to gcc to get object files. For this reason we have a hard
+ // dependency on this specific gcc.
+ asm_args: vec!["-mcpu=msp430".to_string()],
+ linker: Some("msp430-elf-gcc".to_string()),
+ no_integrated_as: true,
+
+ // There are no atomic CAS instructions available in the MSP430
+ // instruction set, and the LLVM backend doesn't currently support
+ // compiler fences so the Atomic* API is missing on this target.
+ // When the LLVM backend gains support for compile fences uncomment
+ // the `singlethread: true` line and set `max_atomic_width` to
+ // `Some(16)`.
+ max_atomic_width: Some(0),
+ atomic_cas: false,
+ // singlethread: true,
+
+ // Because these devices have very little resources having an
+ // unwinder is too onerous so we default to "abort" because the
+ // "unwind" strategy is very rare.
+ panic_strategy: PanicStrategy::Abort,
+
+ // Similarly, one almost always never wants to use relocatable
+ // code because of the extra costs it involves.
+ relocation_model: "static".to_string(),
+
+ // Right now we invoke an external assembler and this isn't
+ // compatible with multiple codegen units, and plus we probably
+ // don't want to invoke that many gcc instances.
+ default_codegen_units: Some(1),
+
+ // Since MSP430 doesn't meaningfully support faulting on illegal
+ // instructions, LLVM generates a call to abort() function instead
+ // of a trap instruction. Such calls are 4 bytes long, and that is
+ // too much overhead for such small target.
+ trap_unreachable: false,
+
+ // See the thumb_base.rs file for an explanation of this value
+ emit_debug_gdb_scripts: false,
+
+ .. Default::default( )
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/netbsd_base.rs b/vendor/rustc-ap-rustc_target/spec/netbsd_base.rs
new file mode 100644
index 0000000..e9cd98c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/netbsd_base.rs
@@ -0,0 +1,29 @@
+use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions, RelroLevel};
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ let mut args = LinkArgs::new();
+ args.insert(LinkerFlavor::Gcc, vec![
+ // GNU-style linkers will use this to omit linking to libraries
+ // which don't actually fulfill any relocations, but only for
+ // libraries which follow this flag. Thus, use it before
+ // specifying libraries to link to.
+ "-Wl,--as-needed".to_string(),
+
+ // Always enable NX protection when it is available
+ "-Wl,-z,noexecstack".to_string(),
+ ]);
+
+ TargetOptions {
+ dynamic_linking: true,
+ executables: true,
+ target_family: Some("unix".to_string()),
+ linker_is_gnu: true,
+ no_default_libraries: false,
+ has_rpath: true,
+ pre_link_args: args,
+ position_independent_executables: true,
+ relro_level: RelroLevel::Full,
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/nvptx64_nvidia_cuda.rs b/vendor/rustc-ap-rustc_target/spec/nvptx64_nvidia_cuda.rs
new file mode 100644
index 0000000..db9d6a7
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/nvptx64_nvidia_cuda.rs
@@ -0,0 +1,73 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult, PanicStrategy, MergeFunctions};
+use crate::spec::abi::Abi;
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ arch: "nvptx64".to_string(),
+ data_layout: "e-i64:64-i128:128-v16:16-v32:32-n16:32:64".to_string(),
+ llvm_target: "nvptx64-nvidia-cuda".to_string(),
+
+ target_os: "cuda".to_string(),
+ target_vendor: "nvidia".to_string(),
+ target_env: String::new(),
+
+ linker_flavor: LinkerFlavor::PtxLinker,
+
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+
+ options: TargetOptions {
+ // The linker can be installed from `crates.io`.
+ linker: Some("rust-ptx-linker".to_string()),
+
+ // With `ptx-linker` approach, it can be later overriden via link flags.
+ cpu: "sm_30".to_string(),
+
+ // FIXME: create tests for the atomics.
+ max_atomic_width: Some(64),
+
+ // Unwinding on CUDA is neither feasible nor useful.
+ panic_strategy: PanicStrategy::Abort,
+
+ // Needed to use `dylib` and `bin` crate types and the linker.
+ dynamic_linking: true,
+ executables: true,
+
+ // Avoid using dylib because it contain metadata not supported
+ // by LLVM NVPTX backend.
+ only_cdylib: true,
+
+ // Let the `ptx-linker` to handle LLVM lowering into MC / assembly.
+ obj_is_bitcode: true,
+
+ // Convinient and predicable naming scheme.
+ dll_prefix: "".to_string(),
+ dll_suffix: ".ptx".to_string(),
+ exe_suffix: ".ptx".to_string(),
+
+ // Disable MergeFunctions LLVM optimisation pass because it can
+ // produce kernel functions that call other kernel functions.
+ // This behavior is not supported by PTX ISA.
+ merge_functions: MergeFunctions::Disabled,
+
+ // FIXME: enable compilation tests for the target and
+ // create the tests for this.
+ abi_blacklist: vec![
+ Abi::Cdecl,
+ Abi::Stdcall,
+ Abi::Fastcall,
+ Abi::Vectorcall,
+ Abi::Thiscall,
+ Abi::Aapcs,
+ Abi::Win64,
+ Abi::SysV64,
+ Abi::Msp430Interrupt,
+ Abi::X86Interrupt,
+ Abi::AmdGpuKernel,
+ ],
+
+ .. Default::default()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/openbsd_base.rs b/vendor/rustc-ap-rustc_target/spec/openbsd_base.rs
new file mode 100644
index 0000000..5bcfd62
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/openbsd_base.rs
@@ -0,0 +1,30 @@
+use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions, RelroLevel};
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ let mut args = LinkArgs::new();
+ args.insert(LinkerFlavor::Gcc, vec![
+ // GNU-style linkers will use this to omit linking to libraries
+ // which don't actually fulfill any relocations, but only for
+ // libraries which follow this flag. Thus, use it before
+ // specifying libraries to link to.
+ "-Wl,--as-needed".to_string(),
+
+ // Always enable NX protection when it is available
+ "-Wl,-z,noexecstack".to_string(),
+ ]);
+
+ TargetOptions {
+ dynamic_linking: true,
+ executables: true,
+ target_family: Some("unix".to_string()),
+ linker_is_gnu: true,
+ has_rpath: true,
+ abi_return_struct_as_int: true,
+ pre_link_args: args,
+ position_independent_executables: true,
+ eliminate_frame_pointer: false, // FIXME 43575
+ relro_level: RelroLevel::Full,
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/powerpc64_unknown_freebsd.rs b/vendor/rustc-ap-rustc_target/spec/powerpc64_unknown_freebsd.rs
new file mode 100644
index 0000000..360876b
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/powerpc64_unknown_freebsd.rs
@@ -0,0 +1,22 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::freebsd_base::opts();
+ base.cpu = "ppc64".to_string();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.max_atomic_width = Some(64);
+
+ Ok(Target {
+ llvm_target: "powerpc64-unknown-freebsd".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-i64:64-n32:64".to_string(),
+ arch: "powerpc64".to_string(),
+ target_os: "freebsd".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/powerpc64_unknown_linux_gnu.rs b/vendor/rustc-ap-rustc_target/spec/powerpc64_unknown_linux_gnu.rs
new file mode 100644
index 0000000..c16db75
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/powerpc64_unknown_linux_gnu.rs
@@ -0,0 +1,26 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult, RelroLevel};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_base::opts();
+ base.cpu = "ppc64".to_string();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.max_atomic_width = Some(64);
+
+ // ld.so in at least RHEL6 on ppc64 has a bug related to BIND_NOW, so only enable partial RELRO
+ // for now. https://github.com/rust-lang/rust/pull/43170#issuecomment-315411474
+ base.relro_level = RelroLevel::Partial;
+
+ Ok(Target {
+ llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-i64:64-n32:64".to_string(),
+ arch: "powerpc64".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/powerpc64_unknown_linux_musl.rs b/vendor/rustc-ap-rustc_target/spec/powerpc64_unknown_linux_musl.rs
new file mode 100644
index 0000000..ac0b743
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/powerpc64_unknown_linux_musl.rs
@@ -0,0 +1,22 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_musl_base::opts();
+ base.cpu = "ppc64".to_string();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.max_atomic_width = Some(64);
+
+ Ok(Target {
+ llvm_target: "powerpc64-unknown-linux-musl".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-i64:64-n32:64".to_string(),
+ arch: "powerpc64".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "musl".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/powerpc64le_unknown_linux_gnu.rs b/vendor/rustc-ap-rustc_target/spec/powerpc64le_unknown_linux_gnu.rs
new file mode 100644
index 0000000..038b925
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/powerpc64le_unknown_linux_gnu.rs
@@ -0,0 +1,22 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_base::opts();
+ base.cpu = "ppc64le".to_string();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.max_atomic_width = Some(64);
+
+ Ok(Target {
+ llvm_target: "powerpc64le-unknown-linux-gnu".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-n32:64".to_string(),
+ arch: "powerpc64".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/powerpc64le_unknown_linux_musl.rs b/vendor/rustc-ap-rustc_target/spec/powerpc64le_unknown_linux_musl.rs
new file mode 100644
index 0000000..5710334
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/powerpc64le_unknown_linux_musl.rs
@@ -0,0 +1,22 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_musl_base::opts();
+ base.cpu = "ppc64le".to_string();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.max_atomic_width = Some(64);
+
+ Ok(Target {
+ llvm_target: "powerpc64le-unknown-linux-musl".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-n32:64".to_string(),
+ arch: "powerpc64".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "musl".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/powerpc_unknown_linux_gnu.rs b/vendor/rustc-ap-rustc_target/spec/powerpc_unknown_linux_gnu.rs
new file mode 100644
index 0000000..38a801d
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/powerpc_unknown_linux_gnu.rs
@@ -0,0 +1,21 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_base::opts();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
+ base.max_atomic_width = Some(32);
+
+ Ok(Target {
+ llvm_target: "powerpc-unknown-linux-gnu".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
+ arch: "powerpc".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/powerpc_unknown_linux_gnuspe.rs b/vendor/rustc-ap-rustc_target/spec/powerpc_unknown_linux_gnuspe.rs
new file mode 100644
index 0000000..675b2c7
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/powerpc_unknown_linux_gnuspe.rs
@@ -0,0 +1,21 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_base::opts();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mspe".to_string());
+ base.max_atomic_width = Some(32);
+
+ Ok(Target {
+ llvm_target: "powerpc-unknown-linux-gnuspe".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
+ arch: "powerpc".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/powerpc_unknown_linux_musl.rs b/vendor/rustc-ap-rustc_target/spec/powerpc_unknown_linux_musl.rs
new file mode 100644
index 0000000..240443a
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/powerpc_unknown_linux_musl.rs
@@ -0,0 +1,21 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_musl_base::opts();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
+ base.max_atomic_width = Some(32);
+
+ Ok(Target {
+ llvm_target: "powerpc-unknown-linux-musl".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
+ arch: "powerpc".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "musl".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/powerpc_unknown_netbsd.rs b/vendor/rustc-ap-rustc_target/spec/powerpc_unknown_netbsd.rs
new file mode 100644
index 0000000..10e7089
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/powerpc_unknown_netbsd.rs
@@ -0,0 +1,21 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::netbsd_base::opts();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
+ base.max_atomic_width = Some(32);
+
+ Ok(Target {
+ llvm_target: "powerpc-unknown-netbsd".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
+ arch: "powerpc".to_string(),
+ target_os: "netbsd".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/redox_base.rs b/vendor/rustc-ap-rustc_target/spec/redox_base.rs
new file mode 100644
index 0000000..dc51aeb
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/redox_base.rs
@@ -0,0 +1,31 @@
+use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions};
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ let mut args = LinkArgs::new();
+ args.insert(LinkerFlavor::Gcc, vec![
+ // We want to be able to strip as much executable code as possible
+ // from the linker command line, and this flag indicates to the
+ // linker that it can avoid linking in dynamic libraries that don't
+ // actually satisfy any symbols up to that point (as with many other
+ // resolutions the linker does). This option only applies to all
+ // following libraries so we're sure to pass it as one of the first
+ // arguments.
+ "-Wl,--as-needed".to_string(),
+
+ // Always enable NX protection when it is available
+ "-Wl,-z,noexecstack".to_string()
+ ]);
+
+ TargetOptions {
+ pre_link_args: args,
+ executables: true,
+ relocation_model: "static".to_string(),
+ disable_redzone: true,
+ eliminate_frame_pointer: false,
+ target_family: None,
+ linker_is_gnu: true,
+ has_elf_tls: true,
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/riscv32imac_unknown_none_elf.rs b/vendor/rustc-ap-rustc_target/spec/riscv32imac_unknown_none_elf.rs
new file mode 100644
index 0000000..5064393
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/riscv32imac_unknown_none_elf.rs
@@ -0,0 +1,31 @@
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy,
+ Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ data_layout: "e-m:e-p:32:32-i64:64-n32-S128".to_string(),
+ llvm_target: "riscv32".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ arch: "riscv32".to_string(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ linker: Some("rust-lld".to_string()),
+ cpu: "generic-rv32".to_string(),
+ max_atomic_width: Some(32),
+ atomic_cas: true,
+ features: "+m,+a,+c".to_string(),
+ executables: true,
+ panic_strategy: PanicStrategy::Abort,
+ relocation_model: "static".to_string(),
+ emit_debug_gdb_scripts: false,
+ abi_blacklist: super::riscv_base::abi_blacklist(),
+ .. Default::default()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/riscv32imc_unknown_none_elf.rs b/vendor/rustc-ap-rustc_target/spec/riscv32imc_unknown_none_elf.rs
new file mode 100644
index 0000000..31e74c5
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/riscv32imc_unknown_none_elf.rs
@@ -0,0 +1,32 @@
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy,
+ Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ data_layout: "e-m:e-p:32:32-i64:64-n32-S128".to_string(),
+ llvm_target: "riscv32".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ arch: "riscv32".to_string(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ linker: Some("rust-lld".to_string()),
+ cpu: "generic-rv32".to_string(),
+ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86005
+ max_atomic_width: None, //Some(32),
+ atomic_cas: false,
+ features: "+m,+c".to_string(),
+ executables: true,
+ panic_strategy: PanicStrategy::Abort,
+ relocation_model: "static".to_string(),
+ emit_debug_gdb_scripts: false,
+ abi_blacklist: super::riscv_base::abi_blacklist(),
+ .. Default::default()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/riscv64gc_unknown_none_elf.rs b/vendor/rustc-ap-rustc_target/spec/riscv64gc_unknown_none_elf.rs
new file mode 100644
index 0000000..2d4070c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/riscv64gc_unknown_none_elf.rs
@@ -0,0 +1,31 @@
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy,
+ Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".to_string(),
+ llvm_target: "riscv64".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ arch: "riscv64".to_string(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ linker: Some("rust-lld".to_string()),
+ cpu: "generic-rv64".to_string(),
+ max_atomic_width: Some(64),
+ atomic_cas: true,
+ features: "+m,+a,+f,+d,+c".to_string(),
+ executables: true,
+ panic_strategy: PanicStrategy::Abort,
+ relocation_model: "static".to_string(),
+ emit_debug_gdb_scripts: false,
+ abi_blacklist: super::riscv_base::abi_blacklist(),
+ .. Default::default()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/riscv64imac_unknown_none_elf.rs b/vendor/rustc-ap-rustc_target/spec/riscv64imac_unknown_none_elf.rs
new file mode 100644
index 0000000..f2e152c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/riscv64imac_unknown_none_elf.rs
@@ -0,0 +1,31 @@
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy,
+ Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".to_string(),
+ llvm_target: "riscv64".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ arch: "riscv64".to_string(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ linker: Some("rust-lld".to_string()),
+ cpu: "generic-rv64".to_string(),
+ max_atomic_width: Some(64),
+ atomic_cas: true,
+ features: "+m,+a,+c".to_string(),
+ executables: true,
+ panic_strategy: PanicStrategy::Abort,
+ relocation_model: "static".to_string(),
+ emit_debug_gdb_scripts: false,
+ abi_blacklist: super::riscv_base::abi_blacklist(),
+ .. Default::default()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/riscv_base.rs b/vendor/rustc-ap-rustc_target/spec/riscv_base.rs
new file mode 100644
index 0000000..ec1dc9b
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/riscv_base.rs
@@ -0,0 +1,20 @@
+use crate::spec::abi::Abi;
+
+// All the calling conventions trigger an assertion(Unsupported calling
+// convention) in llvm on RISCV
+pub fn abi_blacklist() -> Vec<Abi> {
+ vec![
+ Abi::Cdecl,
+ Abi::Stdcall,
+ Abi::Fastcall,
+ Abi::Vectorcall,
+ Abi::Thiscall,
+ Abi::Aapcs,
+ Abi::Win64,
+ Abi::SysV64,
+ Abi::PtxKernel,
+ Abi::Msp430Interrupt,
+ Abi::X86Interrupt,
+ Abi::AmdGpuKernel,
+ ]
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/s390x_unknown_linux_gnu.rs b/vendor/rustc-ap-rustc_target/spec/s390x_unknown_linux_gnu.rs
new file mode 100644
index 0000000..f259787
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/s390x_unknown_linux_gnu.rs
@@ -0,0 +1,27 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_base::opts();
+ // z10 is the oldest CPU supported by LLVM
+ base.cpu = "z10".to_string();
+ // FIXME: The data_layout string below and the ABI implementation in
+ // cabi_s390x.rs are for now hard-coded to assume the no-vector ABI.
+ // Pass the -vector feature string to LLVM to respect this assumption.
+ base.features = "-vector".to_string();
+ base.max_atomic_width = Some(64);
+ base.min_global_align = Some(16);
+
+ Ok(Target {
+ llvm_target: "s390x-unknown-linux-gnu".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64".to_string(),
+ arch: "s390x".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/solaris_base.rs b/vendor/rustc-ap-rustc_target/spec/solaris_base.rs
new file mode 100644
index 0000000..0dfbb13
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/solaris_base.rs
@@ -0,0 +1,14 @@
+use crate::spec::TargetOptions;
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ TargetOptions {
+ dynamic_linking: true,
+ executables: true,
+ has_rpath: true,
+ target_family: Some("unix".to_string()),
+ is_like_solaris: true,
+
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/sparc64_unknown_linux_gnu.rs b/vendor/rustc-ap-rustc_target/spec/sparc64_unknown_linux_gnu.rs
new file mode 100644
index 0000000..c842b22
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/sparc64_unknown_linux_gnu.rs
@@ -0,0 +1,21 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_base::opts();
+ base.cpu = "v9".to_string();
+ base.max_atomic_width = Some(64);
+
+ Ok(Target {
+ llvm_target: "sparc64-unknown-linux-gnu".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-i64:64-n32:64-S128".to_string(),
+ arch: "sparc64".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/sparc64_unknown_netbsd.rs b/vendor/rustc-ap-rustc_target/spec/sparc64_unknown_netbsd.rs
new file mode 100644
index 0000000..78d53e6
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/sparc64_unknown_netbsd.rs
@@ -0,0 +1,22 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::netbsd_base::opts();
+ base.cpu = "v9".to_string();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.max_atomic_width = Some(64);
+
+ Ok(Target {
+ llvm_target: "sparc64-unknown-netbsd".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-i64:64-n32:64-S128".to_string(),
+ arch: "sparc64".to_string(),
+ target_os: "netbsd".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/sparc_unknown_linux_gnu.rs b/vendor/rustc-ap-rustc_target/spec/sparc_unknown_linux_gnu.rs
new file mode 100644
index 0000000..162cd31
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/sparc_unknown_linux_gnu.rs
@@ -0,0 +1,22 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_base::opts();
+ base.cpu = "v9".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mv8plus".to_string());
+
+ Ok(Target {
+ llvm_target: "sparc-unknown-linux-gnu".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-p:32:32-i64:64-f128:64-n32-S64".to_string(),
+ arch: "sparc".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/sparcv9_sun_solaris.rs b/vendor/rustc-ap-rustc_target/spec/sparcv9_sun_solaris.rs
new file mode 100644
index 0000000..acc03fd
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/sparcv9_sun_solaris.rs
@@ -0,0 +1,27 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::solaris_base::opts();
+ base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
+ // llvm calls this "v9"
+ base.cpu = "v9".to_string();
+ base.max_atomic_width = Some(64);
+
+ Ok(Target {
+ llvm_target: "sparcv9-sun-solaris".to_string(),
+ target_endian: "big".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "E-m:e-i64:64-n32:64-S128".to_string(),
+ // Use "sparc64" instead of "sparcv9" here, since the former is already
+ // used widely in the source base. If we ever needed ABI
+ // differentiation from the sparc64, we could, but that would probably
+ // just be confusing.
+ arch: "sparc64".to_string(),
+ target_os: "solaris".to_string(),
+ target_env: String::new(),
+ target_vendor: "sun".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/thumb_base.rs b/vendor/rustc-ap-rustc_target/spec/thumb_base.rs
new file mode 100644
index 0000000..ed0dbb7
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/thumb_base.rs
@@ -0,0 +1,55 @@
+// These `thumbv*` targets cover the ARM Cortex-M family of processors which are widely used in
+// microcontrollers. Namely, all these processors:
+//
+// - Cortex-M0
+// - Cortex-M0+
+// - Cortex-M1
+// - Cortex-M3
+// - Cortex-M4(F)
+// - Cortex-M7(F)
+// - Cortex-M23
+// - Cortex-M33
+//
+// We have opted for these instead of one target per processor (e.g., `cortex-m0`, `cortex-m3`,
+// etc) because the differences between some processors like the cortex-m0 and cortex-m1 are almost
+// non-existent from the POV of codegen so it doesn't make sense to have separate targets for them.
+// And if differences exist between two processors under the same target, rustc flags can be used to
+// optimize for one processor or the other.
+//
+// Also, we have not chosen a single target (`arm-none-eabi`) like GCC does because this makes
+// difficult to integrate Rust code and C code. Targeting the Cortex-M4 requires different gcc flags
+// than the ones you would use for the Cortex-M0 and with a single target it'd be impossible to
+// differentiate one processor from the other.
+//
+// About arm vs thumb in the name. The Cortex-M devices only support the Thumb instruction set,
+// which is more compact (higher code density), and not the ARM instruction set. That's why LLVM
+// triples use thumb instead of arm. We follow suit because having thumb in the name let us
+// differentiate these targets from our other `arm(v7)-*-*-gnueabi(hf)` targets in the context of
+// build scripts / gcc flags.
+
+use std::default::Default;
+use crate::spec::{PanicStrategy, TargetOptions};
+
+pub fn opts() -> TargetOptions {
+ // See rust-lang/rfcs#1645 for a discussion about these defaults
+ TargetOptions {
+ executables: true,
+ // In most cases, LLD is good enough
+ linker: Some("rust-lld".to_string()),
+ // Because these devices have very little resources having an unwinder is too onerous so we
+ // default to "abort" because the "unwind" strategy is very rare.
+ panic_strategy: PanicStrategy::Abort,
+ // Similarly, one almost always never wants to use relocatable code because of the extra
+ // costs it involves.
+ relocation_model: "static".to_string(),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ // When this section is added a volatile load to its start address is also generated. This
+ // volatile load is a footgun as it can end up loading an invalid memory address, depending
+ // on how the user set up their linker scripts. This section adds pretty printer for stuff
+ // like std::Vec, which is not that used in no-std context, so it's best to left it out
+ // until we figure a way to add the pretty printers without requiring a volatile load cf.
+ // rust-lang/rust#44993.
+ emit_debug_gdb_scripts: false,
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/thumbv6m_none_eabi.rs b/vendor/rustc-ap-rustc_target/spec/thumbv6m_none_eabi.rs
new file mode 100644
index 0000000..2ab61b5
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/thumbv6m_none_eabi.rs
@@ -0,0 +1,28 @@
+// Targets the Cortex-M0, Cortex-M0+ and Cortex-M1 processors (ARMv6-M architecture)
+
+use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "thumbv6m-none-eabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: String::new(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ // The ARMv6-M architecture doesn't support unaligned loads/stores so we disable them
+ // with +strict-align.
+ features: "+strict-align".to_string(),
+ // There are no atomic CAS instructions available in the instruction set of the ARMv6-M
+ // architecture
+ atomic_cas: false,
+ .. super::thumb_base::opts()
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/thumbv7a_pc_windows_msvc.rs b/vendor/rustc-ap-rustc_target/spec/thumbv7a_pc_windows_msvc.rs
new file mode 100644
index 0000000..310fac3
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/thumbv7a_pc_windows_msvc.rs
@@ -0,0 +1,40 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult, PanicStrategy};
+
+pub fn target() -> TargetResult {
+ let mut base = super::windows_msvc_base::opts();
+
+ // Prevent error LNK2013: BRANCH24(T) fixup overflow
+ // The LBR optimization tries to eliminate branch islands,
+ // but if the displacement is larger than can fit
+ // in the instruction, this error will occur. The linker
+ // should be smart enough to insert branch islands only
+ // where necessary, but this is not the observed behavior.
+ // Disabling the LBR optimization works around the issue.
+ base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap().push(
+ "/OPT:NOLBR".to_string());
+
+ // FIXME(jordanrh): use PanicStrategy::Unwind when SEH is
+ // implemented for windows/arm in LLVM
+ base.panic_strategy = PanicStrategy::Abort;
+
+ Ok(Target {
+ llvm_target: "thumbv7a-pc-windows-msvc".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:w-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "windows".to_string(),
+ target_env: "msvc".to_string(),
+ target_vendor: "pc".to_string(),
+ linker_flavor: LinkerFlavor::Msvc,
+
+ options: TargetOptions {
+ features: "+vfp3,+neon".to_string(),
+ cpu: "generic".to_string(),
+ max_atomic_width: Some(64),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/thumbv7em_none_eabi.rs b/vendor/rustc-ap-rustc_target/spec/thumbv7em_none_eabi.rs
new file mode 100644
index 0000000..97114c3
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/thumbv7em_none_eabi.rs
@@ -0,0 +1,32 @@
+// Targets the Cortex-M4 and Cortex-M7 processors (ARMv7E-M)
+//
+// This target assumes that the device doesn't have a FPU (Floating Point Unit) and lowers all the
+// floating point operations to software routines (intrinsics).
+//
+// As such, this target uses the "soft" calling convention (ABI) where floating point values are
+// passed to/from subroutines via general purpose registers (R0, R1, etc.).
+//
+// To opt-in to hardware accelerated floating point operations, you can use, for example,
+// `-C target-feature=+vfp4` or `-C target-cpu=cortex-m4`.
+
+use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "thumbv7em-none-eabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: String::new(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ max_atomic_width: Some(32),
+ .. super::thumb_base::opts()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/thumbv7em_none_eabihf.rs b/vendor/rustc-ap-rustc_target/spec/thumbv7em_none_eabihf.rs
new file mode 100644
index 0000000..e4358bd
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/thumbv7em_none_eabihf.rs
@@ -0,0 +1,41 @@
+// Targets the Cortex-M4F and Cortex-M7F processors (ARMv7E-M)
+//
+// This target assumes that the device does have a FPU (Floating Point Unit) and lowers all (single
+// precision) floating point operations to hardware instructions.
+//
+// Additionally, this target uses the "hard" floating convention (ABI) where floating point values
+// are passed to/from subroutines via FPU registers (S0, S1, D0, D1, etc.).
+//
+// To opt into double precision hardware support, use the `-C target-feature=-fp-only-sp` flag.
+
+use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "thumbv7em-none-eabihf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: String::new(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ // `+vfp4` is the lowest common denominator between the Cortex-M4 (vfp4-16) and the
+ // Cortex-M7 (vfp5)
+ // `+d16` both the Cortex-M4 and the Cortex-M7 only have 16 double-precision registers
+ // available
+ // `+fp-only-sp` The Cortex-M4 only supports single precision floating point operations
+ // whereas in the Cortex-M7 double precision is optional
+ //
+ // Reference:
+ // ARMv7-M Architecture Reference Manual - A2.5 The optional floating-point extension
+ features: "+vfp4,+d16,+fp-only-sp".to_string(),
+ max_atomic_width: Some(32),
+ .. super::thumb_base::opts()
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/thumbv7m_none_eabi.rs b/vendor/rustc-ap-rustc_target/spec/thumbv7m_none_eabi.rs
new file mode 100644
index 0000000..daf25b1
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/thumbv7m_none_eabi.rs
@@ -0,0 +1,23 @@
+// Targets the Cortex-M3 processor (ARMv7-M)
+
+use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "thumbv7m-none-eabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: String::new(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ max_atomic_width: Some(32),
+ .. super::thumb_base::opts()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/thumbv7neon_linux_androideabi.rs b/vendor/rustc-ap-rustc_target/spec/thumbv7neon_linux_androideabi.rs
new file mode 100644
index 0000000..e248b930
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/thumbv7neon_linux_androideabi.rs
@@ -0,0 +1,34 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+// This target if is for the Android v7a ABI in thumb mode with
+// NEON unconditionally enabled and, therefore, with 32 FPU registers
+// enabled as well. See section A2.6.2 on page A2-56 in
+// https://static.docs.arm.com/ddi0406/cd/DDI0406C_d_armv7ar_arm.pdf
+
+// See https://developer.android.com/ndk/guides/abis.html#v7a
+// for target ABI requirements.
+
+pub fn target() -> TargetResult {
+ let mut base = super::android_base::opts();
+ base.features = "+v7,+thumb-mode,+thumb2,+vfp3,+neon".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args
+ .get_mut(&LinkerFlavor::Gcc).unwrap().push("-march=armv7-a".to_string());
+
+ Ok(Target {
+ llvm_target: "armv7-none-linux-android".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "android".to_string(),
+ target_env: "".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/thumbv7neon_unknown_linux_gnueabihf.rs b/vendor/rustc-ap-rustc_target/spec/thumbv7neon_unknown_linux_gnueabihf.rs
new file mode 100644
index 0000000..bef62b0
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/thumbv7neon_unknown_linux_gnueabihf.rs
@@ -0,0 +1,32 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+
+// This target is for glibc Linux on ARMv7 with thumb mode enabled
+// (for consistency with Android and Debian-based distributions)
+// and with NEON unconditionally enabled and, therefore, with 32 FPU
+// registers enabled as well. See section A2.6.2 on page A2-56 in
+// https://static.docs.arm.com/ddi0406/cd/DDI0406C_d_armv7ar_arm.pdf
+
+pub fn target() -> TargetResult {
+ let base = super::linux_base::opts();
+ Ok(Target {
+ llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+
+ options: TargetOptions {
+ // Info about features at https://wiki.debian.org/ArmHardFloatPort
+ features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".to_string(),
+ cpu: "generic".to_string(),
+ max_atomic_width: Some(64),
+ abi_blacklist: super::arm_base::abi_blacklist(),
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/thumbv8m_base_none_eabi.rs b/vendor/rustc-ap-rustc_target/spec/thumbv8m_base_none_eabi.rs
new file mode 100644
index 0000000..be8a476
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/thumbv8m_base_none_eabi.rs
@@ -0,0 +1,26 @@
+// Targets the Cortex-M23 processor (Baseline ARMv8-M)
+
+use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "thumbv8m.base-none-eabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: String::new(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ // ARMv8-M baseline doesn't support unaligned loads/stores so we disable them
+ // with +strict-align.
+ features: "+strict-align".to_string(),
+ max_atomic_width: Some(32),
+ .. super::thumb_base::opts()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/thumbv8m_main_none_eabi.rs b/vendor/rustc-ap-rustc_target/spec/thumbv8m_main_none_eabi.rs
new file mode 100644
index 0000000..49ab643
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/thumbv8m_main_none_eabi.rs
@@ -0,0 +1,24 @@
+// Targets the Cortex-M33 processor (Armv8-M Mainline architecture profile),
+// without the Floating Point extension.
+
+use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "thumbv8m.main-none-eabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: String::new(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ max_atomic_width: Some(32),
+ .. super::thumb_base::opts()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/thumbv8m_main_none_eabihf.rs b/vendor/rustc-ap-rustc_target/spec/thumbv8m_main_none_eabihf.rs
new file mode 100644
index 0000000..6a3d8e6
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/thumbv8m_main_none_eabihf.rs
@@ -0,0 +1,30 @@
+// Targets the Cortex-M33 processor (Armv8-M Mainline architecture profile),
+// with the Floating Point extension.
+
+use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetOptions, TargetResult};
+
+pub fn target() -> TargetResult {
+ Ok(Target {
+ llvm_target: "thumbv8m.main-none-eabihf".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
+ arch: "arm".to_string(),
+ target_os: "none".to_string(),
+ target_env: String::new(),
+ target_vendor: String::new(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+
+ options: TargetOptions {
+ // If the Floating Point extension is implemented in the Cortex-M33
+ // processor, the Cortex-M33 Technical Reference Manual states that
+ // the FPU uses the FPv5 architecture, single-precision instructions
+ // and 16 D registers.
+ // These parameters map to the following LLVM features.
+ features: "+fp-armv8,+fp-only-sp,+d16".to_string(),
+ max_atomic_width: Some(32),
+ .. super::thumb_base::opts()
+ },
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/uefi_base.rs b/vendor/rustc-ap-rustc_target/spec/uefi_base.rs
new file mode 100644
index 0000000..631966c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/uefi_base.rs
@@ -0,0 +1,68 @@
+// This defines a base target-configuration for native UEFI systems. The UEFI specification has
+// quite detailed sections on the ABI of all the supported target architectures. In almost all
+// cases it simply follows what Microsoft Windows does. Hence, whenever in doubt, see the MSDN
+// documentation.
+// UEFI uses COFF/PE32+ format for binaries. All binaries must be statically linked. No dynamic
+// linker is supported. As native to COFF, binaries are position-dependent, but will be relocated
+// by the loader if the pre-chosen memory location is already in use.
+// UEFI forbids running code on anything but the boot-CPU. No interrupts are allowed other than
+// the timer-interrupt. Device-drivers are required to use polling-based models. Furthermore, all
+// code runs in the same environment, no process separation is supported.
+
+use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy, TargetOptions};
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ let mut pre_link_args = LinkArgs::new();
+
+ pre_link_args.insert(LinkerFlavor::Lld(LldFlavor::Link), vec![
+ // Suppress the verbose logo and authorship debugging output, which would needlessly
+ // clog any log files.
+ "/NOLOGO".to_string(),
+
+ // UEFI is fully compatible to non-executable data pages. Tell the compiler that
+ // non-code sections can be marked as non-executable, including stack pages. In fact,
+ // firmware might enforce this, so we better let the linker know about this, so it
+ // will fail if the compiler ever tries placing code on the stack (e.g., trampoline
+ // constructs and alike).
+ "/NXCOMPAT".to_string(),
+
+ // There is no runtime for UEFI targets, prevent them from being linked. UEFI targets
+ // must be freestanding.
+ "/nodefaultlib".to_string(),
+
+ // Non-standard subsystems have no default entry-point in PE+ files. We have to define
+ // one. "efi_main" seems to be a common choice amongst other implementations and the
+ // spec.
+ "/entry:efi_main".to_string(),
+
+ // COFF images have a "Subsystem" field in their header, which defines what kind of
+ // program it is. UEFI has 3 fields reserved, which are EFI_APPLICATION,
+ // EFI_BOOT_SERVICE_DRIVER, and EFI_RUNTIME_DRIVER. We default to EFI_APPLICATION,
+ // which is very likely the most common option. Individual projects can override this
+ // with custom linker flags.
+ // The subsystem-type only has minor effects on the application. It defines the memory
+ // regions the application is loaded into (runtime-drivers need to be put into
+ // reserved areas), as well as whether a return from the entry-point is treated as
+ // exit (default for applications).
+ "/subsystem:efi_application".to_string(),
+ ]);
+
+ TargetOptions {
+ dynamic_linking: false,
+ executables: true,
+ disable_redzone: true,
+ exe_suffix: ".efi".to_string(),
+ allows_weak_linkage: false,
+ panic_strategy: PanicStrategy::Abort,
+ stack_probes: true,
+ singlethread: true,
+ emit_debug_gdb_scripts: false,
+
+ linker: Some("lld-link".to_string()),
+ lld_flavor: LldFlavor::Link,
+ pre_link_args,
+
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/wasm32_experimental_emscripten.rs b/vendor/rustc-ap-rustc_target/spec/wasm32_experimental_emscripten.rs
new file mode 100644
index 0000000..5ecd663
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/wasm32_experimental_emscripten.rs
@@ -0,0 +1,43 @@
+use super::{LinkArgs, LinkerFlavor, Target, TargetOptions};
+
+pub fn target() -> Result<Target, String> {
+ let mut post_link_args = LinkArgs::new();
+ post_link_args.insert(LinkerFlavor::Em,
+ vec!["-s".to_string(),
+ "WASM=1".to_string(),
+ "-s".to_string(),
+ "ASSERTIONS=1".to_string(),
+ "-s".to_string(),
+ "ERROR_ON_UNDEFINED_SYMBOLS=1".to_string(),
+ "-g3".to_string()]);
+
+ let opts = TargetOptions {
+ dynamic_linking: false,
+ executables: true,
+ // Today emcc emits two files - a .js file to bootstrap and
+ // possibly interpret the wasm, and a .wasm file
+ exe_suffix: ".js".to_string(),
+ linker_is_gnu: true,
+ link_env: vec![("EMCC_WASM_BACKEND".to_string(), "1".to_string())],
+ allow_asm: false,
+ obj_is_bitcode: true,
+ is_like_emscripten: true,
+ max_atomic_width: Some(32),
+ post_link_args,
+ target_family: Some("unix".to_string()),
+ .. Default::default()
+ };
+ Ok(Target {
+ llvm_target: "wasm32-unknown-unknown".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ target_os: "emscripten".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128".to_string(),
+ arch: "wasm32".to_string(),
+ linker_flavor: LinkerFlavor::Em,
+ options: opts,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/wasm32_unknown_emscripten.rs b/vendor/rustc-ap-rustc_target/spec/wasm32_unknown_emscripten.rs
new file mode 100644
index 0000000..a6e9340
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/wasm32_unknown_emscripten.rs
@@ -0,0 +1,46 @@
+use super::{LinkArgs, LinkerFlavor, Target, TargetOptions};
+
+pub fn target() -> Result<Target, String> {
+ // FIXME(nikic) BINARYEN_TRAP_MODE=clamp is needed to avoid trapping in our
+ // -Zsaturating-float-casts implementation. This can be dropped if/when
+ // we have native fpto[su]i.sat intrinsics, or the implementation otherwise
+ // stops relying on non-trapping fpto[su]i.
+ let mut post_link_args = LinkArgs::new();
+ post_link_args.insert(LinkerFlavor::Em,
+ vec!["-s".to_string(),
+ "BINARYEN=1".to_string(),
+ "-s".to_string(),
+ "ERROR_ON_UNDEFINED_SYMBOLS=1".to_string(),
+ "-s".to_string(),
+ "BINARYEN_TRAP_MODE='clamp'".to_string()]);
+
+ let opts = TargetOptions {
+ dynamic_linking: false,
+ executables: true,
+ // Today emcc emits two files - a .js file to bootstrap and
+ // possibly interpret the wasm, and a .wasm file
+ exe_suffix: ".js".to_string(),
+ linker_is_gnu: true,
+ allow_asm: false,
+ obj_is_bitcode: true,
+ is_like_emscripten: true,
+ max_atomic_width: Some(32),
+ post_link_args,
+ target_family: Some("unix".to_string()),
+ codegen_backend: "emscripten".to_string(),
+ .. Default::default()
+ };
+ Ok(Target {
+ llvm_target: "asmjs-unknown-emscripten".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ target_os: "emscripten".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ data_layout: "e-p:32:32-i64:64-v128:32:128-n32-S128".to_string(),
+ arch: "wasm32".to_string(),
+ linker_flavor: LinkerFlavor::Em,
+ options: opts,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/wasm32_unknown_unknown.rs b/vendor/rustc-ap-rustc_target/spec/wasm32_unknown_unknown.rs
new file mode 100644
index 0000000..ee2160c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/wasm32_unknown_unknown.rs
@@ -0,0 +1,70 @@
+// The wasm32-unknown-unknown target is currently an experimental version of a
+// wasm-based target which does *not* use the Emscripten toolchain. Instead
+// this toolchain is based purely on LLVM's own toolchain, using LLVM's native
+// WebAssembly backend as well as LLD for a native linker.
+//
+// There's some trickery below on crate types supported and various defaults
+// (aka panic=abort by default), but otherwise this is in general a relatively
+// standard target.
+
+use super::{LldFlavor, LinkerFlavor, Target, TargetOptions, PanicStrategy};
+
+pub fn target() -> Result<Target, String> {
+ let opts = TargetOptions {
+ // we allow dynamic linking, but only cdylibs. Basically we allow a
+ // final library artifact that exports some symbols (a wasm module) but
+ // we don't allow intermediate `dylib` crate types
+ dynamic_linking: true,
+ only_cdylib: true,
+
+ // This means we'll just embed a `start` function in the wasm module
+ executables: true,
+
+ // relatively self-explanatory!
+ exe_suffix: ".wasm".to_string(),
+ dll_prefix: String::new(),
+ dll_suffix: ".wasm".to_string(),
+ linker_is_gnu: false,
+
+ max_atomic_width: Some(64),
+
+ // Unwinding doesn't work right now, so the whole target unconditionally
+ // defaults to panic=abort. Note that this is guaranteed to change in
+ // the future once unwinding is implemented. Don't rely on this.
+ panic_strategy: PanicStrategy::Abort,
+
+ // Wasm doesn't have atomics yet, so tell LLVM that we're in a single
+ // threaded model which will legalize atomics to normal operations.
+ singlethread: true,
+
+ // no dynamic linking, no need for default visibility!
+ default_hidden_visibility: true,
+
+ // we use the LLD shipped with the Rust toolchain by default
+ linker: Some("rust-lld".to_owned()),
+ lld_flavor: LldFlavor::Wasm,
+
+ // No need for indirection here, simd types can always be passed by
+ // value as the whole module either has simd or not, which is different
+ // from x86 (for example) where programs can have functions that don't
+ // enable simd features.
+ simd_types_indirect: false,
+
+ .. Default::default()
+ };
+ Ok(Target {
+ llvm_target: "wasm32-unknown-unknown".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ // This is basically guaranteed to change in the future, don't rely on
+ // this. Use `not(target_os = "emscripten")` for now.
+ target_os: "unknown".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128".to_string(),
+ arch: "wasm32".to_string(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Wasm),
+ options: opts,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/windows_base.rs b/vendor/rustc-ap-rustc_target/spec/windows_base.rs
new file mode 100644
index 0000000..38db9cd
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/windows_base.rs
@@ -0,0 +1,99 @@
+use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions};
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ let mut pre_link_args = LinkArgs::new();
+ pre_link_args.insert(LinkerFlavor::Gcc, vec![
+ // And here, we see obscure linker flags #45. On windows, it has been
+ // found to be necessary to have this flag to compile liblibc.
+ //
+ // First a bit of background. On Windows, the file format is not ELF,
+ // but COFF (at least according to LLVM). COFF doesn't officially allow
+ // for section names over 8 characters, apparently. Our metadata
+ // section, ".note.rustc", you'll note is over 8 characters.
+ //
+ // On more recent versions of gcc on mingw, apparently the section name
+ // is *not* truncated, but rather stored elsewhere in a separate lookup
+ // table. On older versions of gcc, they apparently always truncated th
+ // section names (at least in some cases). Truncating the section name
+ // actually creates "invalid" objects [1] [2], but only for some
+ // introspection tools, not in terms of whether it can be loaded.
+ //
+ // Long story short, passing this flag forces the linker to *not*
+ // truncate section names (so we can find the metadata section after
+ // it's compiled). The real kicker is that rust compiled just fine on
+ // windows for quite a long time *without* this flag, so I have no idea
+ // why it suddenly started failing for liblibc. Regardless, we
+ // definitely don't want section name truncation, so we're keeping this
+ // flag for windows.
+ //
+ // [1] - https://sourceware.org/bugzilla/show_bug.cgi?id=13130
+ // [2] - https://code.google.com/p/go/issues/detail?id=2139
+ "-Wl,--enable-long-section-names".to_string(),
+
+ // Tell GCC to avoid linker plugins, because we are not bundling
+ // them with Windows installer, and Rust does its own LTO anyways.
+ "-fno-use-linker-plugin".to_string(),
+
+ // Always enable DEP (NX bit) when it is available
+ "-Wl,--nxcompat".to_string(),
+
+ // Do not use the standard system startup files or libraries when linking
+ "-nostdlib".to_string(),
+ ]);
+
+ let mut late_link_args = LinkArgs::new();
+ late_link_args.insert(LinkerFlavor::Gcc, vec![
+ "-lmingwex".to_string(),
+ "-lmingw32".to_string(),
+ "-lgcc".to_string(), // alas, mingw* libraries above depend on libgcc
+ "-lmsvcrt".to_string(),
+ // mingw's msvcrt is a weird hybrid import library and static library.
+ // And it seems that the linker fails to use import symbols from msvcrt
+ // that are required from functions in msvcrt in certain cases. For example
+ // `_fmode` that is used by an implementation of `__p__fmode` in x86_64.
+ // Listing the library twice seems to fix that, and seems to also be done
+ // by mingw's gcc (Though not sure if it's done on purpose, or by mistake).
+ //
+ // See https://github.com/rust-lang/rust/pull/47483
+ "-lmsvcrt".to_string(),
+ "-luser32".to_string(),
+ "-lkernel32".to_string(),
+ ]);
+
+ TargetOptions {
+ // FIXME(#13846) this should be enabled for windows
+ function_sections: false,
+ linker: Some("gcc".to_string()),
+ dynamic_linking: true,
+ executables: true,
+ dll_prefix: String::new(),
+ dll_suffix: ".dll".to_string(),
+ exe_suffix: ".exe".to_string(),
+ staticlib_prefix: String::new(),
+ staticlib_suffix: ".lib".to_string(),
+ no_default_libraries: true,
+ target_family: Some("windows".to_string()),
+ is_like_windows: true,
+ allows_weak_linkage: false,
+ pre_link_args,
+ pre_link_objects_exe: vec![
+ "crt2.o".to_string(), // mingw C runtime initialization for executables
+ "rsbegin.o".to_string(), // Rust compiler runtime initialization, see rsbegin.rs
+ ],
+ pre_link_objects_dll: vec![
+ "dllcrt2.o".to_string(), // mingw C runtime initialization for dlls
+ "rsbegin.o".to_string(),
+ ],
+ late_link_args,
+ post_link_objects: vec![
+ "rsend.o".to_string()
+ ],
+ custom_unwind_resume: true,
+ abi_return_struct_as_int: true,
+ emit_debug_gdb_scripts: false,
+ requires_uwtable: true,
+
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/windows_msvc_base.rs b/vendor/rustc-ap-rustc_target/spec/windows_msvc_base.rs
new file mode 100644
index 0000000..fdd747c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/windows_msvc_base.rs
@@ -0,0 +1,31 @@
+use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions};
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ let mut args = LinkArgs::new();
+ args.insert(LinkerFlavor::Msvc,
+ vec!["/NOLOGO".to_string(),
+ "/NXCOMPAT".to_string()]);
+
+ TargetOptions {
+ function_sections: true,
+ dynamic_linking: true,
+ executables: true,
+ dll_prefix: String::new(),
+ dll_suffix: ".dll".to_string(),
+ exe_suffix: ".exe".to_string(),
+ staticlib_prefix: String::new(),
+ staticlib_suffix: ".lib".to_string(),
+ target_family: Some("windows".to_string()),
+ is_like_windows: true,
+ is_like_msvc: true,
+ pre_link_args: args,
+ crt_static_allows_dylibs: true,
+ crt_static_respected: true,
+ abi_return_struct_as_int: true,
+ emit_debug_gdb_scripts: false,
+ requires_uwtable: true,
+
+ .. Default::default()
+ }
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_apple_darwin.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_apple_darwin.rs
new file mode 100644
index 0000000..0911ce0
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_apple_darwin.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::apple_base::opts();
+ base.cpu = "core2".to_string();
+ base.max_atomic_width = Some(128); // core2 support cmpxchg16b
+ base.eliminate_frame_pointer = false;
+ base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-apple-darwin".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:o-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "macos".to_string(),
+ target_env: String::new(),
+ target_vendor: "apple".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_apple_ios.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_apple_ios.rs
new file mode 100644
index 0000000..1f9594b
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_apple_ios.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
+use super::apple_ios_base::{opts, Arch};
+
+pub fn target() -> TargetResult {
+ let base = opts(Arch::X86_64)?;
+ Ok(Target {
+ llvm_target: "x86_64-apple-ios".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:o-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "ios".to_string(),
+ target_env: String::new(),
+ target_vendor: "apple".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: TargetOptions {
+ max_atomic_width: Some(64),
+ stack_probes: true,
+ .. base
+ }
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_fortanix_unknown_sgx.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_fortanix_unknown_sgx.rs
new file mode 100644
index 0000000..7c369da
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_fortanix_unknown_sgx.rs
@@ -0,0 +1,71 @@
+use std::iter;
+
+use super::{LinkerFlavor, PanicStrategy, Target, TargetOptions};
+
+pub fn target() -> Result<Target, String> {
+ const PRE_LINK_ARGS: &[&str] = &[
+ "-Wl,--as-needed",
+ "-Wl,-z,noexecstack",
+ "-m64",
+ "-fuse-ld=gold",
+ "-nostdlib",
+ "-shared",
+ "-Wl,-e,sgx_entry",
+ "-Wl,-Bstatic",
+ "-Wl,--gc-sections",
+ "-Wl,-z,text",
+ "-Wl,-z,norelro",
+ "-Wl,--rosegment",
+ "-Wl,--no-undefined",
+ "-Wl,--error-unresolved-symbols",
+ "-Wl,--no-undefined-version",
+ "-Wl,-Bsymbolic",
+ "-Wl,--export-dynamic",
+ ];
+
+ const EXPORT_SYMBOLS: &[&str] = &[
+ "sgx_entry",
+ "HEAP_BASE",
+ "HEAP_SIZE",
+ "RELA",
+ "RELACOUNT",
+ "ENCLAVE_SIZE",
+ "CFGDATA_BASE",
+ "DEBUG",
+ "EH_FRM_HDR_BASE",
+ "EH_FRM_HDR_SIZE",
+ "TEXT_BASE",
+ "TEXT_SIZE",
+ ];
+ let opts = TargetOptions {
+ dynamic_linking: false,
+ executables: true,
+ linker_is_gnu: true,
+ max_atomic_width: Some(64),
+ panic_strategy: PanicStrategy::Unwind,
+ cpu: "x86-64".into(),
+ features: "+rdrnd,+rdseed".into(),
+ position_independent_executables: true,
+ pre_link_args: iter::once((
+ LinkerFlavor::Gcc,
+ PRE_LINK_ARGS.iter().cloned().map(String::from).collect(),
+ ))
+ .collect(),
+ post_link_objects: vec!["libunwind.a".into()],
+ override_export_symbols: Some(EXPORT_SYMBOLS.iter().cloned().map(String::from).collect()),
+ ..Default::default()
+ };
+ Ok(Target {
+ llvm_target: "x86_64-unknown-linux-gnu".into(),
+ target_endian: "little".into(),
+ target_pointer_width: "64".into(),
+ target_c_int_width: "32".into(),
+ target_os: "unknown".into(),
+ target_env: "sgx".into(),
+ target_vendor: "fortanix".into(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".into(),
+ arch: "x86_64".into(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: opts,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_fuchsia.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_fuchsia.rs
new file mode 100644
index 0000000..a24d432c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_fuchsia.rs
@@ -0,0 +1,22 @@
+use crate::spec::{LldFlavor, LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::fuchsia_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-fuchsia".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "fuchsia".to_string(),
+ target_env: String::new(),
+ target_vendor: String::new(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_linux_android.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_linux_android.rs
new file mode 100644
index 0000000..c3c6c7b
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_linux_android.rs
@@ -0,0 +1,25 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::android_base::opts();
+ base.cpu = "x86-64".to_string();
+ // https://developer.android.com/ndk/guides/abis.html#86-64
+ base.features = "+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-linux-android".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "android".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_pc_windows_gnu.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_pc_windows_gnu.rs
new file mode 100644
index 0000000..35e0d55
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_pc_windows_gnu.rs
@@ -0,0 +1,22 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::windows_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.max_atomic_width = Some(64);
+
+ Ok(Target {
+ llvm_target: "x86_64-pc-windows-gnu".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:w-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "windows".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "pc".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_pc_windows_msvc.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_pc_windows_msvc.rs
new file mode 100644
index 0000000..073d49b
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_pc_windows_msvc.rs
@@ -0,0 +1,22 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::windows_msvc_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.has_elf_tls = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-pc-windows-msvc".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:w-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "windows".to_string(),
+ target_env: "msvc".to_string(),
+ target_vendor: "pc".to_string(),
+ linker_flavor: LinkerFlavor::Msvc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_rumprun_netbsd.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_rumprun_netbsd.rs
new file mode 100644
index 0000000..a2c706c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_rumprun_netbsd.rs
@@ -0,0 +1,29 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::netbsd_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.linker = Some("x86_64-rumprun-netbsd-gcc".to_string());
+ base.max_atomic_width = Some(64);
+
+ base.dynamic_linking = false;
+ base.has_rpath = false;
+ base.position_independent_executables = false;
+ base.disable_redzone = true;
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-rumprun-netbsd".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "netbsd".to_string(),
+ target_env: String::new(),
+ target_vendor: "rumprun".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_sun_solaris.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_sun_solaris.rs
new file mode 100644
index 0000000..3bf3f51
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_sun_solaris.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::solaris_base::opts();
+ base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-pc-solaris".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "solaris".to_string(),
+ target_env: String::new(),
+ target_vendor: "sun".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_bitrig.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_bitrig.rs
new file mode 100644
index 0000000..999d93a
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_bitrig.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::bitrig_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-bitrig".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "bitrig".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_cloudabi.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_cloudabi.rs
new file mode 100644
index 0000000..d48120c
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_cloudabi.rs
@@ -0,0 +1,24 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::cloudabi_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.linker = Some("x86_64-unknown-cloudabi-cc".to_string());
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-cloudabi".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "cloudabi".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_dragonfly.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_dragonfly.rs
new file mode 100644
index 0000000..f55ee69
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_dragonfly.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::dragonfly_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-dragonfly".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "dragonfly".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_freebsd.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_freebsd.rs
new file mode 100644
index 0000000..1d9c5cc
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_freebsd.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::freebsd_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-freebsd".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "freebsd".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_haiku.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_haiku.rs
new file mode 100644
index 0000000..4ab15fa
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_haiku.rs
@@ -0,0 +1,25 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::haiku_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
+ base.stack_probes = true;
+ // This option is required to build executables on Haiku x86_64
+ base.position_independent_executables = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-haiku".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "haiku".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_hermit.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_hermit.rs
new file mode 100644
index 0000000..a696ee1
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_hermit.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::hermit_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.linker = Some("x86_64-hermit-gcc".to_string());
+ base.max_atomic_width = Some(64);
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-hermit".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "hermit".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_l4re_uclibc.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_l4re_uclibc.rs
new file mode 100644
index 0000000..e5fdb38
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_l4re_uclibc.rs
@@ -0,0 +1,21 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::l4re_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-l4re-uclibc".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "l4re".to_string(),
+ target_env: "uclibc".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Ld,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_linux_gnu.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_linux_gnu.rs
new file mode 100644
index 0000000..cb279e8
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_linux_gnu.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-linux-gnu".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_linux_gnux32.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_linux_gnux32.rs
new file mode 100644
index 0000000..0b2d7aa
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_linux_gnux32.rs
@@ -0,0 +1,27 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mx32".to_string());
+ base.stack_probes = true;
+ base.has_elf_tls = false;
+ // BUG(GabrielMajeri): disabling the PLT on x86_64 Linux with x32 ABI
+ // breaks code gen. See LLVM bug 36743
+ base.needs_plt = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-linux-gnux32".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "32".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-p:32:32-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "gnu".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_linux_musl.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_linux_musl.rs
new file mode 100644
index 0000000..2e1bc83
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_linux_musl.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::linux_musl_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-linux-musl".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "linux".to_string(),
+ target_env: "musl".to_string(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_netbsd.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_netbsd.rs
new file mode 100644
index 0000000..ffc4f1d
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_netbsd.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::netbsd_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-netbsd".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "netbsd".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_openbsd.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_openbsd.rs
new file mode 100644
index 0000000..f2abd10
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_openbsd.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::openbsd_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-openbsd".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "openbsd".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_redox.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_redox.rs
new file mode 100644
index 0000000..f0a4519
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_redox.rs
@@ -0,0 +1,23 @@
+use crate::spec::{LinkerFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::redox_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+ base.stack_probes = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-redox".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "redox".to_string(),
+ target_env: String::new(),
+ target_vendor: "unknown".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ options: base,
+ })
+}
diff --git a/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_uefi.rs b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_uefi.rs
new file mode 100644
index 0000000..443479f
--- /dev/null
+++ b/vendor/rustc-ap-rustc_target/spec/x86_64_unknown_uefi.rs
@@ -0,0 +1,50 @@
+// This defines the amd64 target for UEFI systems as described in the UEFI specification. See the
+// uefi-base module for generic UEFI options. On x86_64 systems (mostly called "x64" in the spec)
+// UEFI systems always run in long-mode, have the interrupt-controller pre-configured and force a
+// single-CPU execution.
+// The win64 ABI is used. It differs from the sysv64 ABI, so we must use a windows target with
+// LLVM. "x86_64-unknown-windows" is used to get the minimal subset of windows-specific features.
+
+use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetResult};
+
+pub fn target() -> TargetResult {
+ let mut base = super::uefi_base::opts();
+ base.cpu = "x86-64".to_string();
+ base.max_atomic_width = Some(64);
+
+ // We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to
+ // enable these CPU features explicitly before their first use, otherwise their instructions
+ // will trigger an exception. Rust does not inject any code that enables AVX/MMX/SSE
+ // instruction sets, so this must be done by the firmware. However, existing firmware is known
+ // to leave these uninitialized, thus triggering exceptions if we make use of them. Which is
+ // why we avoid them and instead use soft-floats. This is also what GRUB and friends did so
+ // far.
+ // If you initialize FP units yourself, you can override these flags with custom linker
+ // arguments, thus giving you access to full MMX/SSE acceleration.
+ base.features = "-mmx,-sse,+soft-float".to_string();
+
+ // UEFI systems run without a host OS, hence we cannot assume any code locality. We must tell
+ // LLVM to expect code to reference any address in the address-space. The "large" code-model
+ // places no locality-restrictions, so it fits well here.
+ base.code_model = Some("large".to_string());
+
+ // UEFI mirrors the calling-conventions used on windows. In case of x86-64 this means small
+ // structs will be returned as int. This shouldn't matter much, since the restrictions placed
+ // by the UEFI specifications forbid any ABI to return structures.
+ base.abi_return_struct_as_int = true;
+
+ Ok(Target {
+ llvm_target: "x86_64-unknown-windows".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ target_c_int_width: "32".to_string(),
+ data_layout: "e-m:w-i64:64-f80:128-n8:16:32:64-S128".to_string(),
+ target_os: "uefi".to_string(),
+ target_env: "".to_string(),
+ target_vendor: "unknown".to_string(),
+ arch: "x86_64".to_string(),
+ linker_flavor: LinkerFlavor::Lld(LldFlavor::Link),
+
+ options: base,
+ })
+}