1 This is gccgo.info, produced by makeinfo version 6.5 from gccgo.texi. 2 3 Copyright (C) 2010-2022 Free Software Foundation, Inc. 4 5 Permission is granted to copy, distribute and/or modify this document 6 under the terms of the GNU Free Documentation License, Version 1.3 or 7 any later version published by the Free Software Foundation; with no 8 Invariant Sections, the Front-Cover Texts being (a) (see below), and 9 with the Back-Cover Texts being (b) (see below). A copy of the license 10 is included in the section entitled "GNU Free Documentation License". 11 12 (a) The FSF's Front-Cover Text is: 13 14 A GNU Manual 15 16 (b) The FSF's Back-Cover Text is: 17 18 You have freedom to copy and modify this GNU Manual, like GNU 19 software. Copies published by the Free Software Foundation raise funds 20 for GNU development. 21 INFO-DIR-SECTION Software development 22 START-INFO-DIR-ENTRY 23 * Gccgo: (gccgo). A GCC-based compiler for the Go language 24 END-INFO-DIR-ENTRY 25 26 27 Copyright (C) 2010-2022 Free Software Foundation, Inc. 28 29 Permission is granted to copy, distribute and/or modify this document 30 under the terms of the GNU Free Documentation License, Version 1.3 or 31 any later version published by the Free Software Foundation; with no 32 Invariant Sections, the Front-Cover Texts being (a) (see below), and 33 with the Back-Cover Texts being (b) (see below). A copy of the license 34 is included in the section entitled "GNU Free Documentation License". 35 36 (a) The FSF's Front-Cover Text is: 37 38 A GNU Manual 39 40 (b) The FSF's Back-Cover Text is: 41 42 You have freedom to copy and modify this GNU Manual, like GNU 43 software. Copies published by the Free Software Foundation raise funds 44 for GNU development. 45 46 47 File: gccgo.info, Node: Top, Next: Copying, Up: (dir) 48 49 Introduction 50 ************ 51 52 This manual describes how to use 'gccgo', the GNU compiler for the Go 53 programming language. This manual is specifically about 'gccgo'. For 54 more information about the Go programming language in general, including 55 language specifications and standard package documentation, see 56 <https://golang.org/>. 57 58 * Menu: 59 60 * Copying:: The GNU General Public License. 61 * GNU Free Documentation License:: 62 How you can share and copy this manual. 63 * Invoking gccgo:: How to run gccgo. 64 * Import and Export:: Importing and exporting package data. 65 * Compiler Directives:: Comments to control compilation. 66 * C Interoperability:: Calling C from Go and vice-versa. 67 * Index:: Index. 68 69 70 File: gccgo.info, Node: Copying, Next: GNU Free Documentation License, Prev: Top, Up: Top 71 72 GNU General Public License 73 ************************** 74 75 Version 3, 29 June 2007 76 77 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> 78 79 Everyone is permitted to copy and distribute verbatim copies of this 80 license document, but changing it is not allowed. 81 82 Preamble 83 ======== 84 85 The GNU General Public License is a free, copyleft license for software 86 and other kinds of works. 87 88 The licenses for most software and other practical works are designed 89 to take away your freedom to share and change the works. By contrast, 90 the GNU General Public License is intended to guarantee your freedom to 91 share and change all versions of a program-to make sure it remains free 92 software for all its users. We, the Free Software Foundation, use the 93 GNU General Public License for most of our software; it applies also to 94 any other work released this way by its authors. You can apply it to 95 your programs, too. 96 97 When we speak of free software, we are referring to freedom, not 98 price. Our General Public Licenses are designed to make sure that you 99 have the freedom to distribute copies of free software (and charge for 100 them if you wish), that you receive source code or can get it if you 101 want it, that you can change the software or use pieces of it in new 102 free programs, and that you know you can do these things. 103 104 To protect your rights, we need to prevent others from denying you 105 these rights or asking you to surrender the rights. Therefore, you have 106 certain responsibilities if you distribute copies of the software, or if 107 you modify it: responsibilities to respect the freedom of others. 108 109 For example, if you distribute copies of such a program, whether 110 gratis or for a fee, you must pass on to the recipients the same 111 freedoms that you received. You must make sure that they, too, receive 112 or can get the source code. And you must show them these terms so they 113 know their rights. 114 115 Developers that use the GNU GPL protect your rights with two steps: 116 (1) assert copyright on the software, and (2) offer you this License 117 giving you legal permission to copy, distribute and/or modify it. 118 119 For the developers' and authors' protection, the GPL clearly explains 120 that there is no warranty for this free software. For both users' and 121 authors' sake, the GPL requires that modified versions be marked as 122 changed, so that their problems will not be attributed erroneously to 123 authors of previous versions. 124 125 Some devices are designed to deny users access to install or run 126 modified versions of the software inside them, although the manufacturer 127 can do so. This is fundamentally incompatible with the aim of 128 protecting users' freedom to change the software. The systematic 129 pattern of such abuse occurs in the area of products for individuals to 130 use, which is precisely where it is most unacceptable. Therefore, we 131 have designed this version of the GPL to prohibit the practice for those 132 products. If such problems arise substantially in other domains, we 133 stand ready to extend this provision to those domains in future versions 134 of the GPL, as needed to protect the freedom of users. 135 136 Finally, every program is threatened constantly by software patents. 137 States should not allow patents to restrict development and use of 138 software on general-purpose computers, but in those that do, we wish to 139 avoid the special danger that patents applied to a free program could 140 make it effectively proprietary. To prevent this, the GPL assures that 141 patents cannot be used to render the program non-free. 142 143 The precise terms and conditions for copying, distribution and 144 modification follow. 145 146 TERMS AND CONDITIONS 147 ==================== 148 149 0. Definitions. 150 151 "This License" refers to version 3 of the GNU General Public 152 License. 153 154 "Copyright" also means copyright-like laws that apply to other 155 kinds of works, such as semiconductor masks. 156 157 "The Program" refers to any copyrightable work licensed under this 158 License. Each licensee is addressed as "you". "Licensees" and 159 "recipients" may be individuals or organizations. 160 161 To "modify" a work means to copy from or adapt all or part of the 162 work in a fashion requiring copyright permission, other than the 163 making of an exact copy. The resulting work is called a "modified 164 version" of the earlier work or a work "based on" the earlier work. 165 166 A "covered work" means either the unmodified Program or a work 167 based on the Program. 168 169 To "propagate" a work means to do anything with it that, without 170 permission, would make you directly or secondarily liable for 171 infringement under applicable copyright law, except executing it on 172 a computer or modifying a private copy. Propagation includes 173 copying, distribution (with or without modification), making 174 available to the public, and in some countries other activities as 175 well. 176 177 To "convey" a work means any kind of propagation that enables other 178 parties to make or receive copies. Mere interaction with a user 179 through a computer network, with no transfer of a copy, is not 180 conveying. 181 182 An interactive user interface displays "Appropriate Legal Notices" 183 to the extent that it includes a convenient and prominently visible 184 feature that (1) displays an appropriate copyright notice, and (2) 185 tells the user that there is no warranty for the work (except to 186 the extent that warranties are provided), that licensees may convey 187 the work under this License, and how to view a copy of this 188 License. If the interface presents a list of user commands or 189 options, such as a menu, a prominent item in the list meets this 190 criterion. 191 192 1. Source Code. 193 194 The "source code" for a work means the preferred form of the work 195 for making modifications to it. "Object code" means any non-source 196 form of a work. 197 198 A "Standard Interface" means an interface that either is an 199 official standard defined by a recognized standards body, or, in 200 the case of interfaces specified for a particular programming 201 language, one that is widely used among developers working in that 202 language. 203 204 The "System Libraries" of an executable work include anything, 205 other than the work as a whole, that (a) is included in the normal 206 form of packaging a Major Component, but which is not part of that 207 Major Component, and (b) serves only to enable use of the work with 208 that Major Component, or to implement a Standard Interface for 209 which an implementation is available to the public in source code 210 form. A "Major Component", in this context, means a major 211 essential component (kernel, window system, and so on) of the 212 specific operating system (if any) on which the executable work 213 runs, or a compiler used to produce the work, or an object code 214 interpreter used to run it. 215 216 The "Corresponding Source" for a work in object code form means all 217 the source code needed to generate, install, and (for an executable 218 work) run the object code and to modify the work, including scripts 219 to control those activities. However, it does not include the 220 work's System Libraries, or general-purpose tools or generally 221 available free programs which are used unmodified in performing 222 those activities but which are not part of the work. For example, 223 Corresponding Source includes interface definition files associated 224 with source files for the work, and the source code for shared 225 libraries and dynamically linked subprograms that the work is 226 specifically designed to require, such as by intimate data 227 communication or control flow between those subprograms and other 228 parts of the work. 229 230 The Corresponding Source need not include anything that users can 231 regenerate automatically from other parts of the Corresponding 232 Source. 233 234 The Corresponding Source for a work in source code form is that 235 same work. 236 237 2. Basic Permissions. 238 239 All rights granted under this License are granted for the term of 240 copyright on the Program, and are irrevocable provided the stated 241 conditions are met. This License explicitly affirms your unlimited 242 permission to run the unmodified Program. The output from running 243 a covered work is covered by this License only if the output, given 244 its content, constitutes a covered work. This License acknowledges 245 your rights of fair use or other equivalent, as provided by 246 copyright law. 247 248 You may make, run and propagate covered works that you do not 249 convey, without conditions so long as your license otherwise 250 remains in force. You may convey covered works to others for the 251 sole purpose of having them make modifications exclusively for you, 252 or provide you with facilities for running those works, provided 253 that you comply with the terms of this License in conveying all 254 material for which you do not control copyright. Those thus making 255 or running the covered works for you must do so exclusively on your 256 behalf, under your direction and control, on terms that prohibit 257 them from making any copies of your copyrighted material outside 258 their relationship with you. 259 260 Conveying under any other circumstances is permitted solely under 261 the conditions stated below. Sublicensing is not allowed; section 262 10 makes it unnecessary. 263 264 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 265 266 No covered work shall be deemed part of an effective technological 267 measure under any applicable law fulfilling obligations under 268 article 11 of the WIPO copyright treaty adopted on 20 December 269 1996, or similar laws prohibiting or restricting circumvention of 270 such measures. 271 272 When you convey a covered work, you waive any legal power to forbid 273 circumvention of technological measures to the extent such 274 circumvention is effected by exercising rights under this License 275 with respect to the covered work, and you disclaim any intention to 276 limit operation or modification of the work as a means of 277 enforcing, against the work's users, your or third parties' legal 278 rights to forbid circumvention of technological measures. 279 280 4. Conveying Verbatim Copies. 281 282 You may convey verbatim copies of the Program's source code as you 283 receive it, in any medium, provided that you conspicuously and 284 appropriately publish on each copy an appropriate copyright notice; 285 keep intact all notices stating that this License and any 286 non-permissive terms added in accord with section 7 apply to the 287 code; keep intact all notices of the absence of any warranty; and 288 give all recipients a copy of this License along with the Program. 289 290 You may charge any price or no price for each copy that you convey, 291 and you may offer support or warranty protection for a fee. 292 293 5. Conveying Modified Source Versions. 294 295 You may convey a work based on the Program, or the modifications to 296 produce it from the Program, in the form of source code under the 297 terms of section 4, provided that you also meet all of these 298 conditions: 299 300 a. The work must carry prominent notices stating that you 301 modified it, and giving a relevant date. 302 303 b. The work must carry prominent notices stating that it is 304 released under this License and any conditions added under 305 section 7. This requirement modifies the requirement in 306 section 4 to "keep intact all notices". 307 308 c. You must license the entire work, as a whole, under this 309 License to anyone who comes into possession of a copy. This 310 License will therefore apply, along with any applicable 311 section 7 additional terms, to the whole of the work, and all 312 its parts, regardless of how they are packaged. This License 313 gives no permission to license the work in any other way, but 314 it does not invalidate such permission if you have separately 315 received it. 316 317 d. If the work has interactive user interfaces, each must display 318 Appropriate Legal Notices; however, if the Program has 319 interactive interfaces that do not display Appropriate Legal 320 Notices, your work need not make them do so. 321 322 A compilation of a covered work with other separate and independent 323 works, which are not by their nature extensions of the covered 324 work, and which are not combined with it such as to form a larger 325 program, in or on a volume of a storage or distribution medium, is 326 called an "aggregate" if the compilation and its resulting 327 copyright are not used to limit the access or legal rights of the 328 compilation's users beyond what the individual works permit. 329 Inclusion of a covered work in an aggregate does not cause this 330 License to apply to the other parts of the aggregate. 331 332 6. Conveying Non-Source Forms. 333 334 You may convey a covered work in object code form under the terms 335 of sections 4 and 5, provided that you also convey the 336 machine-readable Corresponding Source under the terms of this 337 License, in one of these ways: 338 339 a. Convey the object code in, or embodied in, a physical product 340 (including a physical distribution medium), accompanied by the 341 Corresponding Source fixed on a durable physical medium 342 customarily used for software interchange. 343 344 b. Convey the object code in, or embodied in, a physical product 345 (including a physical distribution medium), accompanied by a 346 written offer, valid for at least three years and valid for as 347 long as you offer spare parts or customer support for that 348 product model, to give anyone who possesses the object code 349 either (1) a copy of the Corresponding Source for all the 350 software in the product that is covered by this License, on a 351 durable physical medium customarily used for software 352 interchange, for a price no more than your reasonable cost of 353 physically performing this conveying of source, or (2) access 354 to copy the Corresponding Source from a network server at no 355 charge. 356 357 c. Convey individual copies of the object code with a copy of the 358 written offer to provide the Corresponding Source. This 359 alternative is allowed only occasionally and noncommercially, 360 and only if you received the object code with such an offer, 361 in accord with subsection 6b. 362 363 d. Convey the object code by offering access from a designated 364 place (gratis or for a charge), and offer equivalent access to 365 the Corresponding Source in the same way through the same 366 place at no further charge. You need not require recipients 367 to copy the Corresponding Source along with the object code. 368 If the place to copy the object code is a network server, the 369 Corresponding Source may be on a different server (operated by 370 you or a third party) that supports equivalent copying 371 facilities, provided you maintain clear directions next to the 372 object code saying where to find the Corresponding Source. 373 Regardless of what server hosts the Corresponding Source, you 374 remain obligated to ensure that it is available for as long as 375 needed to satisfy these requirements. 376 377 e. Convey the object code using peer-to-peer transmission, 378 provided you inform other peers where the object code and 379 Corresponding Source of the work are being offered to the 380 general public at no charge under subsection 6d. 381 382 A separable portion of the object code, whose source code is 383 excluded from the Corresponding Source as a System Library, need 384 not be included in conveying the object code work. 385 386 A "User Product" is either (1) a "consumer product", which means 387 any tangible personal property which is normally used for personal, 388 family, or household purposes, or (2) anything designed or sold for 389 incorporation into a dwelling. In determining whether a product is 390 a consumer product, doubtful cases shall be resolved in favor of 391 coverage. For a particular product received by a particular user, 392 "normally used" refers to a typical or common use of that class of 393 product, regardless of the status of the particular user or of the 394 way in which the particular user actually uses, or expects or is 395 expected to use, the product. A product is a consumer product 396 regardless of whether the product has substantial commercial, 397 industrial or non-consumer uses, unless such uses represent the 398 only significant mode of use of the product. 399 400 "Installation Information" for a User Product means any methods, 401 procedures, authorization keys, or other information required to 402 install and execute modified versions of a covered work in that 403 User Product from a modified version of its Corresponding Source. 404 The information must suffice to ensure that the continued 405 functioning of the modified object code is in no case prevented or 406 interfered with solely because modification has been made. 407 408 If you convey an object code work under this section in, or with, 409 or specifically for use in, a User Product, and the conveying 410 occurs as part of a transaction in which the right of possession 411 and use of the User Product is transferred to the recipient in 412 perpetuity or for a fixed term (regardless of how the transaction 413 is characterized), the Corresponding Source conveyed under this 414 section must be accompanied by the Installation Information. But 415 this requirement does not apply if neither you nor any third party 416 retains the ability to install modified object code on the User 417 Product (for example, the work has been installed in ROM). 418 419 The requirement to provide Installation Information does not 420 include a requirement to continue to provide support service, 421 warranty, or updates for a work that has been modified or installed 422 by the recipient, or for the User Product in which it has been 423 modified or installed. Access to a network may be denied when the 424 modification itself materially and adversely affects the operation 425 of the network or violates the rules and protocols for 426 communication across the network. 427 428 Corresponding Source conveyed, and Installation Information 429 provided, in accord with this section must be in a format that is 430 publicly documented (and with an implementation available to the 431 public in source code form), and must require no special password 432 or key for unpacking, reading or copying. 433 434 7. Additional Terms. 435 436 "Additional permissions" are terms that supplement the terms of 437 this License by making exceptions from one or more of its 438 conditions. Additional permissions that are applicable to the 439 entire Program shall be treated as though they were included in 440 this License, to the extent that they are valid under applicable 441 law. If additional permissions apply only to part of the Program, 442 that part may be used separately under those permissions, but the 443 entire Program remains governed by this License without regard to 444 the additional permissions. 445 446 When you convey a copy of a covered work, you may at your option 447 remove any additional permissions from that copy, or from any part 448 of it. (Additional permissions may be written to require their own 449 removal in certain cases when you modify the work.) You may place 450 additional permissions on material, added by you to a covered work, 451 for which you have or can give appropriate copyright permission. 452 453 Notwithstanding any other provision of this License, for material 454 you add to a covered work, you may (if authorized by the copyright 455 holders of that material) supplement the terms of this License with 456 terms: 457 458 a. Disclaiming warranty or limiting liability differently from 459 the terms of sections 15 and 16 of this License; or 460 461 b. Requiring preservation of specified reasonable legal notices 462 or author attributions in that material or in the Appropriate 463 Legal Notices displayed by works containing it; or 464 465 c. Prohibiting misrepresentation of the origin of that material, 466 or requiring that modified versions of such material be marked 467 in reasonable ways as different from the original version; or 468 469 d. Limiting the use for publicity purposes of names of licensors 470 or authors of the material; or 471 472 e. Declining to grant rights under trademark law for use of some 473 trade names, trademarks, or service marks; or 474 475 f. Requiring indemnification of licensors and authors of that 476 material by anyone who conveys the material (or modified 477 versions of it) with contractual assumptions of liability to 478 the recipient, for any liability that these contractual 479 assumptions directly impose on those licensors and authors. 480 481 All other non-permissive additional terms are considered "further 482 restrictions" within the meaning of section 10. If the Program as 483 you received it, or any part of it, contains a notice stating that 484 it is governed by this License along with a term that is a further 485 restriction, you may remove that term. If a license document 486 contains a further restriction but permits relicensing or conveying 487 under this License, you may add to a covered work material governed 488 by the terms of that license document, provided that the further 489 restriction does not survive such relicensing or conveying. 490 491 If you add terms to a covered work in accord with this section, you 492 must place, in the relevant source files, a statement of the 493 additional terms that apply to those files, or a notice indicating 494 where to find the applicable terms. 495 496 Additional terms, permissive or non-permissive, may be stated in 497 the form of a separately written license, or stated as exceptions; 498 the above requirements apply either way. 499 500 8. Termination. 501 502 You may not propagate or modify a covered work except as expressly 503 provided under this License. Any attempt otherwise to propagate or 504 modify it is void, and will automatically terminate your rights 505 under this License (including any patent licenses granted under the 506 third paragraph of section 11). 507 508 However, if you cease all violation of this License, then your 509 license from a particular copyright holder is reinstated (a) 510 provisionally, unless and until the copyright holder explicitly and 511 finally terminates your license, and (b) permanently, if the 512 copyright holder fails to notify you of the violation by some 513 reasonable means prior to 60 days after the cessation. 514 515 Moreover, your license from a particular copyright holder is 516 reinstated permanently if the copyright holder notifies you of the 517 violation by some reasonable means, this is the first time you have 518 received notice of violation of this License (for any work) from 519 that copyright holder, and you cure the violation prior to 30 days 520 after your receipt of the notice. 521 522 Termination of your rights under this section does not terminate 523 the licenses of parties who have received copies or rights from you 524 under this License. If your rights have been terminated and not 525 permanently reinstated, you do not qualify to receive new licenses 526 for the same material under section 10. 527 528 9. Acceptance Not Required for Having Copies. 529 530 You are not required to accept this License in order to receive or 531 run a copy of the Program. Ancillary propagation of a covered work 532 occurring solely as a consequence of using peer-to-peer 533 transmission to receive a copy likewise does not require 534 acceptance. However, nothing other than this License grants you 535 permission to propagate or modify any covered work. These actions 536 infringe copyright if you do not accept this License. Therefore, 537 by modifying or propagating a covered work, you indicate your 538 acceptance of this License to do so. 539 540 10. Automatic Licensing of Downstream Recipients. 541 542 Each time you convey a covered work, the recipient automatically 543 receives a license from the original licensors, to run, modify and 544 propagate that work, subject to this License. You are not 545 responsible for enforcing compliance by third parties with this 546 License. 547 548 An "entity transaction" is a transaction transferring control of an 549 organization, or substantially all assets of one, or subdividing an 550 organization, or merging organizations. If propagation of a 551 covered work results from an entity transaction, each party to that 552 transaction who receives a copy of the work also receives whatever 553 licenses to the work the party's predecessor in interest had or 554 could give under the previous paragraph, plus a right to possession 555 of the Corresponding Source of the work from the predecessor in 556 interest, if the predecessor has it or can get it with reasonable 557 efforts. 558 559 You may not impose any further restrictions on the exercise of the 560 rights granted or affirmed under this License. For example, you 561 may not impose a license fee, royalty, or other charge for exercise 562 of rights granted under this License, and you may not initiate 563 litigation (including a cross-claim or counterclaim in a lawsuit) 564 alleging that any patent claim is infringed by making, using, 565 selling, offering for sale, or importing the Program or any portion 566 of it. 567 568 11. Patents. 569 570 A "contributor" is a copyright holder who authorizes use under this 571 License of the Program or a work on which the Program is based. 572 The work thus licensed is called the contributor's "contributor 573 version". 574 575 A contributor's "essential patent claims" are all patent claims 576 owned or controlled by the contributor, whether already acquired or 577 hereafter acquired, that would be infringed by some manner, 578 permitted by this License, of making, using, or selling its 579 contributor version, but do not include claims that would be 580 infringed only as a consequence of further modification of the 581 contributor version. For purposes of this definition, "control" 582 includes the right to grant patent sublicenses in a manner 583 consistent with the requirements of this License. 584 585 Each contributor grants you a non-exclusive, worldwide, 586 royalty-free patent license under the contributor's essential 587 patent claims, to make, use, sell, offer for sale, import and 588 otherwise run, modify and propagate the contents of its contributor 589 version. 590 591 In the following three paragraphs, a "patent license" is any 592 express agreement or commitment, however denominated, not to 593 enforce a patent (such as an express permission to practice a 594 patent or covenant not to sue for patent infringement). To "grant" 595 such a patent license to a party means to make such an agreement or 596 commitment not to enforce a patent against the party. 597 598 If you convey a covered work, knowingly relying on a patent 599 license, and the Corresponding Source of the work is not available 600 for anyone to copy, free of charge and under the terms of this 601 License, through a publicly available network server or other 602 readily accessible means, then you must either (1) cause the 603 Corresponding Source to be so available, or (2) arrange to deprive 604 yourself of the benefit of the patent license for this particular 605 work, or (3) arrange, in a manner consistent with the requirements 606 of this License, to extend the patent license to downstream 607 recipients. "Knowingly relying" means you have actual knowledge 608 that, but for the patent license, your conveying the covered work 609 in a country, or your recipient's use of the covered work in a 610 country, would infringe one or more identifiable patents in that 611 country that you have reason to believe are valid. 612 613 If, pursuant to or in connection with a single transaction or 614 arrangement, you convey, or propagate by procuring conveyance of, a 615 covered work, and grant a patent license to some of the parties 616 receiving the covered work authorizing them to use, propagate, 617 modify or convey a specific copy of the covered work, then the 618 patent license you grant is automatically extended to all 619 recipients of the covered work and works based on it. 620 621 A patent license is "discriminatory" if it does not include within 622 the scope of its coverage, prohibits the exercise of, or is 623 conditioned on the non-exercise of one or more of the rights that 624 are specifically granted under this License. You may not convey a 625 covered work if you are a party to an arrangement with a third 626 party that is in the business of distributing software, under which 627 you make payment to the third party based on the extent of your 628 activity of conveying the work, and under which the third party 629 grants, to any of the parties who would receive the covered work 630 from you, a discriminatory patent license (a) in connection with 631 copies of the covered work conveyed by you (or copies made from 632 those copies), or (b) primarily for and in connection with specific 633 products or compilations that contain the covered work, unless you 634 entered into that arrangement, or that patent license was granted, 635 prior to 28 March 2007. 636 637 Nothing in this License shall be construed as excluding or limiting 638 any implied license or other defenses to infringement that may 639 otherwise be available to you under applicable patent law. 640 641 12. No Surrender of Others' Freedom. 642 643 If conditions are imposed on you (whether by court order, agreement 644 or otherwise) that contradict the conditions of this License, they 645 do not excuse you from the conditions of this License. If you 646 cannot convey a covered work so as to satisfy simultaneously your 647 obligations under this License and any other pertinent obligations, 648 then as a consequence you may not convey it at all. For example, 649 if you agree to terms that obligate you to collect a royalty for 650 further conveying from those to whom you convey the Program, the 651 only way you could satisfy both those terms and this License would 652 be to refrain entirely from conveying the Program. 653 654 13. Use with the GNU Affero General Public License. 655 656 Notwithstanding any other provision of this License, you have 657 permission to link or combine any covered work with a work licensed 658 under version 3 of the GNU Affero General Public License into a 659 single combined work, and to convey the resulting work. The terms 660 of this License will continue to apply to the part which is the 661 covered work, but the special requirements of the GNU Affero 662 General Public License, section 13, concerning interaction through 663 a network will apply to the combination as such. 664 665 14. Revised Versions of this License. 666 667 The Free Software Foundation may publish revised and/or new 668 versions of the GNU General Public License from time to time. Such 669 new versions will be similar in spirit to the present version, but 670 may differ in detail to address new problems or concerns. 671 672 Each version is given a distinguishing version number. If the 673 Program specifies that a certain numbered version of the GNU 674 General Public License "or any later version" applies to it, you 675 have the option of following the terms and conditions either of 676 that numbered version or of any later version published by the Free 677 Software Foundation. If the Program does not specify a version 678 number of the GNU General Public License, you may choose any 679 version ever published by the Free Software Foundation. 680 681 If the Program specifies that a proxy can decide which future 682 versions of the GNU General Public License can be used, that 683 proxy's public statement of acceptance of a version permanently 684 authorizes you to choose that version for the Program. 685 686 Later license versions may give you additional or different 687 permissions. However, no additional obligations are imposed on any 688 author or copyright holder as a result of your choosing to follow a 689 later version. 690 691 15. Disclaimer of Warranty. 692 693 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 694 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE 695 COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" 696 WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, 697 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 698 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE 699 RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. 700 SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL 701 NECESSARY SERVICING, REPAIR OR CORRECTION. 702 703 16. Limitation of Liability. 704 705 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 706 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES 707 AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR 708 DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 709 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE 710 THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA 711 BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 712 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 713 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF 714 THE POSSIBILITY OF SUCH DAMAGES. 715 716 17. Interpretation of Sections 15 and 16. 717 718 If the disclaimer of warranty and limitation of liability provided 719 above cannot be given local legal effect according to their terms, 720 reviewing courts shall apply local law that most closely 721 approximates an absolute waiver of all civil liability in 722 connection with the Program, unless a warranty or assumption of 723 liability accompanies a copy of the Program in return for a fee. 724 725 END OF TERMS AND CONDITIONS 726 =========================== 727 728 How to Apply These Terms to Your New Programs 729 ============================================= 730 731 If you develop a new program, and you want it to be of the greatest 732 possible use to the public, the best way to achieve this is to make it 733 free software which everyone can redistribute and change under these 734 terms. 735 736 To do so, attach the following notices to the program. It is safest 737 to attach them to the start of each source file to most effectively 738 state the exclusion of warranty; and each file should have at least the 739 "copyright" line and a pointer to where the full notice is found. 740 741 ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. 742 Copyright (C) YEAR NAME OF AUTHOR 743 744 This program is free software: you can redistribute it and/or modify 745 it under the terms of the GNU General Public License as published by 746 the Free Software Foundation, either version 3 of the License, or (at 747 your option) any later version. 748 749 This program is distributed in the hope that it will be useful, but 750 WITHOUT ANY WARRANTY; without even the implied warranty of 751 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 752 General Public License for more details. 753 754 You should have received a copy of the GNU General Public License 755 along with this program. If not, see <https://www.gnu.org/licenses/>. 756 757 Also add information on how to contact you by electronic and paper 758 mail. 759 760 If the program does terminal interaction, make it output a short 761 notice like this when it starts in an interactive mode: 762 763 PROGRAM Copyright (C) YEAR NAME OF AUTHOR 764 This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. 765 This is free software, and you are welcome to redistribute it 766 under certain conditions; type 'show c' for details. 767 768 The hypothetical commands 'show w' and 'show c' should show the 769 appropriate parts of the General Public License. Of course, your 770 program's commands might be different; for a GUI interface, you would 771 use an "about box". 772 773 You should also get your employer (if you work as a programmer) or 774 school, if any, to sign a "copyright disclaimer" for the program, if 775 necessary. For more information on this, and how to apply and follow 776 the GNU GPL, see <https://www.gnu.org/licenses/>. 777 778 The GNU General Public License does not permit incorporating your 779 program into proprietary programs. If your program is a subroutine 780 library, you may consider it more useful to permit linking proprietary 781 applications with the library. If this is what you want to do, use the 782 GNU Lesser General Public License instead of this License. But first, 783 please read <https://www.gnu.org/licenses/why-not-lgpl.html>. 784 785 786 File: gccgo.info, Node: GNU Free Documentation License, Next: Invoking gccgo, Prev: Copying, Up: Top 787 788 GNU Free Documentation License 789 ****************************** 790 791 Version 1.3, 3 November 2008 792 793 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. 794 <https://fsf.org/> 795 796 Everyone is permitted to copy and distribute verbatim copies 797 of this license document, but changing it is not allowed. 798 799 0. PREAMBLE 800 801 The purpose of this License is to make a manual, textbook, or other 802 functional and useful document "free" in the sense of freedom: to 803 assure everyone the effective freedom to copy and redistribute it, 804 with or without modifying it, either commercially or 805 noncommercially. Secondarily, this License preserves for the 806 author and publisher a way to get credit for their work, while not 807 being considered responsible for modifications made by others. 808 809 This License is a kind of "copyleft", which means that derivative 810 works of the document must themselves be free in the same sense. 811 It complements the GNU General Public License, which is a copyleft 812 license designed for free software. 813 814 We have designed this License in order to use it for manuals for 815 free software, because free software needs free documentation: a 816 free program should come with manuals providing the same freedoms 817 that the software does. But this License is not limited to 818 software manuals; it can be used for any textual work, regardless 819 of subject matter or whether it is published as a printed book. We 820 recommend this License principally for works whose purpose is 821 instruction or reference. 822 823 1. APPLICABILITY AND DEFINITIONS 824 825 This License applies to any manual or other work, in any medium, 826 that contains a notice placed by the copyright holder saying it can 827 be distributed under the terms of this License. Such a notice 828 grants a world-wide, royalty-free license, unlimited in duration, 829 to use that work under the conditions stated herein. The 830 "Document", below, refers to any such manual or work. Any member 831 of the public is a licensee, and is addressed as "you". You accept 832 the license if you copy, modify or distribute the work in a way 833 requiring permission under copyright law. 834 835 A "Modified Version" of the Document means any work containing the 836 Document or a portion of it, either copied verbatim, or with 837 modifications and/or translated into another language. 838 839 A "Secondary Section" is a named appendix or a front-matter section 840 of the Document that deals exclusively with the relationship of the 841 publishers or authors of the Document to the Document's overall 842 subject (or to related matters) and contains nothing that could 843 fall directly within that overall subject. (Thus, if the Document 844 is in part a textbook of mathematics, a Secondary Section may not 845 explain any mathematics.) The relationship could be a matter of 846 historical connection with the subject or with related matters, or 847 of legal, commercial, philosophical, ethical or political position 848 regarding them. 849 850 The "Invariant Sections" are certain Secondary Sections whose 851 titles are designated, as being those of Invariant Sections, in the 852 notice that says that the Document is released under this License. 853 If a section does not fit the above definition of Secondary then it 854 is not allowed to be designated as Invariant. The Document may 855 contain zero Invariant Sections. If the Document does not identify 856 any Invariant Sections then there are none. 857 858 The "Cover Texts" are certain short passages of text that are 859 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 860 that says that the Document is released under this License. A 861 Front-Cover Text may be at most 5 words, and a Back-Cover Text may 862 be at most 25 words. 863 864 A "Transparent" copy of the Document means a machine-readable copy, 865 represented in a format whose specification is available to the 866 general public, that is suitable for revising the document 867 straightforwardly with generic text editors or (for images composed 868 of pixels) generic paint programs or (for drawings) some widely 869 available drawing editor, and that is suitable for input to text 870 formatters or for automatic translation to a variety of formats 871 suitable for input to text formatters. A copy made in an otherwise 872 Transparent file format whose markup, or absence of markup, has 873 been arranged to thwart or discourage subsequent modification by 874 readers is not Transparent. An image format is not Transparent if 875 used for any substantial amount of text. A copy that is not 876 "Transparent" is called "Opaque". 877 878 Examples of suitable formats for Transparent copies include plain 879 ASCII without markup, Texinfo input format, LaTeX input format, 880 SGML or XML using a publicly available DTD, and standard-conforming 881 simple HTML, PostScript or PDF designed for human modification. 882 Examples of transparent image formats include PNG, XCF and JPG. 883 Opaque formats include proprietary formats that can be read and 884 edited only by proprietary word processors, SGML or XML for which 885 the DTD and/or processing tools are not generally available, and 886 the machine-generated HTML, PostScript or PDF produced by some word 887 processors for output purposes only. 888 889 The "Title Page" means, for a printed book, the title page itself, 890 plus such following pages as are needed to hold, legibly, the 891 material this License requires to appear in the title page. For 892 works in formats which do not have any title page as such, "Title 893 Page" means the text near the most prominent appearance of the 894 work's title, preceding the beginning of the body of the text. 895 896 The "publisher" means any person or entity that distributes copies 897 of the Document to the public. 898 899 A section "Entitled XYZ" means a named subunit of the Document 900 whose title either is precisely XYZ or contains XYZ in parentheses 901 following text that translates XYZ in another language. (Here XYZ 902 stands for a specific section name mentioned below, such as 903 "Acknowledgements", "Dedications", "Endorsements", or "History".) 904 To "Preserve the Title" of such a section when you modify the 905 Document means that it remains a section "Entitled XYZ" according 906 to this definition. 907 908 The Document may include Warranty Disclaimers next to the notice 909 which states that this License applies to the Document. These 910 Warranty Disclaimers are considered to be included by reference in 911 this License, but only as regards disclaiming warranties: any other 912 implication that these Warranty Disclaimers may have is void and 913 has no effect on the meaning of this License. 914 915 2. VERBATIM COPYING 916 917 You may copy and distribute the Document in any medium, either 918 commercially or noncommercially, provided that this License, the 919 copyright notices, and the license notice saying this License 920 applies to the Document are reproduced in all copies, and that you 921 add no other conditions whatsoever to those of this License. You 922 may not use technical measures to obstruct or control the reading 923 or further copying of the copies you make or distribute. However, 924 you may accept compensation in exchange for copies. If you 925 distribute a large enough number of copies you must also follow the 926 conditions in section 3. 927 928 You may also lend copies, under the same conditions stated above, 929 and you may publicly display copies. 930 931 3. COPYING IN QUANTITY 932 933 If you publish printed copies (or copies in media that commonly 934 have printed covers) of the Document, numbering more than 100, and 935 the Document's license notice requires Cover Texts, you must 936 enclose the copies in covers that carry, clearly and legibly, all 937 these Cover Texts: Front-Cover Texts on the front cover, and 938 Back-Cover Texts on the back cover. Both covers must also clearly 939 and legibly identify you as the publisher of these copies. The 940 front cover must present the full title with all words of the title 941 equally prominent and visible. You may add other material on the 942 covers in addition. Copying with changes limited to the covers, as 943 long as they preserve the title of the Document and satisfy these 944 conditions, can be treated as verbatim copying in other respects. 945 946 If the required texts for either cover are too voluminous to fit 947 legibly, you should put the first ones listed (as many as fit 948 reasonably) on the actual cover, and continue the rest onto 949 adjacent pages. 950 951 If you publish or distribute Opaque copies of the Document 952 numbering more than 100, you must either include a machine-readable 953 Transparent copy along with each Opaque copy, or state in or with 954 each Opaque copy a computer-network location from which the general 955 network-using public has access to download using public-standard 956 network protocols a complete Transparent copy of the Document, free 957 of added material. If you use the latter option, you must take 958 reasonably prudent steps, when you begin distribution of Opaque 959 copies in quantity, to ensure that this Transparent copy will 960 remain thus accessible at the stated location until at least one 961 year after the last time you distribute an Opaque copy (directly or 962 through your agents or retailers) of that edition to the public. 963 964 It is requested, but not required, that you contact the authors of 965 the Document well before redistributing any large number of copies, 966 to give them a chance to provide you with an updated version of the 967 Document. 968 969 4. MODIFICATIONS 970 971 You may copy and distribute a Modified Version of the Document 972 under the conditions of sections 2 and 3 above, provided that you 973 release the Modified Version under precisely this License, with the 974 Modified Version filling the role of the Document, thus licensing 975 distribution and modification of the Modified Version to whoever 976 possesses a copy of it. In addition, you must do these things in 977 the Modified Version: 978 979 A. Use in the Title Page (and on the covers, if any) a title 980 distinct from that of the Document, and from those of previous 981 versions (which should, if there were any, be listed in the 982 History section of the Document). You may use the same title 983 as a previous version if the original publisher of that 984 version gives permission. 985 986 B. List on the Title Page, as authors, one or more persons or 987 entities responsible for authorship of the modifications in 988 the Modified Version, together with at least five of the 989 principal authors of the Document (all of its principal 990 authors, if it has fewer than five), unless they release you 991 from this requirement. 992 993 C. State on the Title page the name of the publisher of the 994 Modified Version, as the publisher. 995 996 D. Preserve all the copyright notices of the Document. 997 998 E. Add an appropriate copyright notice for your modifications 999 adjacent to the other copyright notices. 1000 1001 F. Include, immediately after the copyright notices, a license 1002 notice giving the public permission to use the Modified 1003 Version under the terms of this License, in the form shown in 1004 the Addendum below. 1005 1006 G. Preserve in that license notice the full lists of Invariant 1007 Sections and required Cover Texts given in the Document's 1008 license notice. 1009 1010 H. Include an unaltered copy of this License. 1011 1012 I. Preserve the section Entitled "History", Preserve its Title, 1013 and add to it an item stating at least the title, year, new 1014 authors, and publisher of the Modified Version as given on the 1015 Title Page. If there is no section Entitled "History" in the 1016 Document, create one stating the title, year, authors, and 1017 publisher of the Document as given on its Title Page, then add 1018 an item describing the Modified Version as stated in the 1019 previous sentence. 1020 1021 J. Preserve the network location, if any, given in the Document 1022 for public access to a Transparent copy of the Document, and 1023 likewise the network locations given in the Document for 1024 previous versions it was based on. These may be placed in the 1025 "History" section. You may omit a network location for a work 1026 that was published at least four years before the Document 1027 itself, or if the original publisher of the version it refers 1028 to gives permission. 1029 1030 K. For any section Entitled "Acknowledgements" or "Dedications", 1031 Preserve the Title of the section, and preserve in the section 1032 all the substance and tone of each of the contributor 1033 acknowledgements and/or dedications given therein. 1034 1035 L. Preserve all the Invariant Sections of the Document, unaltered 1036 in their text and in their titles. Section numbers or the 1037 equivalent are not considered part of the section titles. 1038 1039 M. Delete any section Entitled "Endorsements". Such a section 1040 may not be included in the Modified Version. 1041 1042 N. Do not retitle any existing section to be Entitled 1043 "Endorsements" or to conflict in title with any Invariant 1044 Section. 1045 1046 O. Preserve any Warranty Disclaimers. 1047 1048 If the Modified Version includes new front-matter sections or 1049 appendices that qualify as Secondary Sections and contain no 1050 material copied from the Document, you may at your option designate 1051 some or all of these sections as invariant. To do this, add their 1052 titles to the list of Invariant Sections in the Modified Version's 1053 license notice. These titles must be distinct from any other 1054 section titles. 1055 1056 You may add a section Entitled "Endorsements", provided it contains 1057 nothing but endorsements of your Modified Version by various 1058 parties--for example, statements of peer review or that the text 1059 has been approved by an organization as the authoritative 1060 definition of a standard. 1061 1062 You may add a passage of up to five words as a Front-Cover Text, 1063 and a passage of up to 25 words as a Back-Cover Text, to the end of 1064 the list of Cover Texts in the Modified Version. Only one passage 1065 of Front-Cover Text and one of Back-Cover Text may be added by (or 1066 through arrangements made by) any one entity. If the Document 1067 already includes a cover text for the same cover, previously added 1068 by you or by arrangement made by the same entity you are acting on 1069 behalf of, you may not add another; but you may replace the old 1070 one, on explicit permission from the previous publisher that added 1071 the old one. 1072 1073 The author(s) and publisher(s) of the Document do not by this 1074 License give permission to use their names for publicity for or to 1075 assert or imply endorsement of any Modified Version. 1076 1077 5. COMBINING DOCUMENTS 1078 1079 You may combine the Document with other documents released under 1080 this License, under the terms defined in section 4 above for 1081 modified versions, provided that you include in the combination all 1082 of the Invariant Sections of all of the original documents, 1083 unmodified, and list them all as Invariant Sections of your 1084 combined work in its license notice, and that you preserve all 1085 their Warranty Disclaimers. 1086 1087 The combined work need only contain one copy of this License, and 1088 multiple identical Invariant Sections may be replaced with a single 1089 copy. If there are multiple Invariant Sections with the same name 1090 but different contents, make the title of each such section unique 1091 by adding at the end of it, in parentheses, the name of the 1092 original author or publisher of that section if known, or else a 1093 unique number. Make the same adjustment to the section titles in 1094 the list of Invariant Sections in the license notice of the 1095 combined work. 1096 1097 In the combination, you must combine any sections Entitled 1098 "History" in the various original documents, forming one section 1099 Entitled "History"; likewise combine any sections Entitled 1100 "Acknowledgements", and any sections Entitled "Dedications". You 1101 must delete all sections Entitled "Endorsements." 1102 1103 6. COLLECTIONS OF DOCUMENTS 1104 1105 You may make a collection consisting of the Document and other 1106 documents released under this License, and replace the individual 1107 copies of this License in the various documents with a single copy 1108 that is included in the collection, provided that you follow the 1109 rules of this License for verbatim copying of each of the documents 1110 in all other respects. 1111 1112 You may extract a single document from such a collection, and 1113 distribute it individually under this License, provided you insert 1114 a copy of this License into the extracted document, and follow this 1115 License in all other respects regarding verbatim copying of that 1116 document. 1117 1118 7. AGGREGATION WITH INDEPENDENT WORKS 1119 1120 A compilation of the Document or its derivatives with other 1121 separate and independent documents or works, in or on a volume of a 1122 storage or distribution medium, is called an "aggregate" if the 1123 copyright resulting from the compilation is not used to limit the 1124 legal rights of the compilation's users beyond what the individual 1125 works permit. When the Document is included in an aggregate, this 1126 License does not apply to the other works in the aggregate which 1127 are not themselves derivative works of the Document. 1128 1129 If the Cover Text requirement of section 3 is applicable to these 1130 copies of the Document, then if the Document is less than one half 1131 of the entire aggregate, the Document's Cover Texts may be placed 1132 on covers that bracket the Document within the aggregate, or the 1133 electronic equivalent of covers if the Document is in electronic 1134 form. Otherwise they must appear on printed covers that bracket 1135 the whole aggregate. 1136 1137 8. TRANSLATION 1138 1139 Translation is considered a kind of modification, so you may 1140 distribute translations of the Document under the terms of section 1141 4. Replacing Invariant Sections with translations requires special 1142 permission from their copyright holders, but you may include 1143 translations of some or all Invariant Sections in addition to the 1144 original versions of these Invariant Sections. You may include a 1145 translation of this License, and all the license notices in the 1146 Document, and any Warranty Disclaimers, provided that you also 1147 include the original English version of this License and the 1148 original versions of those notices and disclaimers. In case of a 1149 disagreement between the translation and the original version of 1150 this License or a notice or disclaimer, the original version will 1151 prevail. 1152 1153 If a section in the Document is Entitled "Acknowledgements", 1154 "Dedications", or "History", the requirement (section 4) to 1155 Preserve its Title (section 1) will typically require changing the 1156 actual title. 1157 1158 9. TERMINATION 1159 1160 You may not copy, modify, sublicense, or distribute the Document 1161 except as expressly provided under this License. Any attempt 1162 otherwise to copy, modify, sublicense, or distribute it is void, 1163 and will automatically terminate your rights under this License. 1164 1165 However, if you cease all violation of this License, then your 1166 license from a particular copyright holder is reinstated (a) 1167 provisionally, unless and until the copyright holder explicitly and 1168 finally terminates your license, and (b) permanently, if the 1169 copyright holder fails to notify you of the violation by some 1170 reasonable means prior to 60 days after the cessation. 1171 1172 Moreover, your license from a particular copyright holder is 1173 reinstated permanently if the copyright holder notifies you of the 1174 violation by some reasonable means, this is the first time you have 1175 received notice of violation of this License (for any work) from 1176 that copyright holder, and you cure the violation prior to 30 days 1177 after your receipt of the notice. 1178 1179 Termination of your rights under this section does not terminate 1180 the licenses of parties who have received copies or rights from you 1181 under this License. If your rights have been terminated and not 1182 permanently reinstated, receipt of a copy of some or all of the 1183 same material does not give you any rights to use it. 1184 1185 10. FUTURE REVISIONS OF THIS LICENSE 1186 1187 The Free Software Foundation may publish new, revised versions of 1188 the GNU Free Documentation License from time to time. Such new 1189 versions will be similar in spirit to the present version, but may 1190 differ in detail to address new problems or concerns. See 1191 <https://www.gnu.org/copyleft/>. 1192 1193 Each version of the License is given a distinguishing version 1194 number. If the Document specifies that a particular numbered 1195 version of this License "or any later version" applies to it, you 1196 have the option of following the terms and conditions either of 1197 that specified version or of any later version that has been 1198 published (not as a draft) by the Free Software Foundation. If the 1199 Document does not specify a version number of this License, you may 1200 choose any version ever published (not as a draft) by the Free 1201 Software Foundation. If the Document specifies that a proxy can 1202 decide which future versions of this License can be used, that 1203 proxy's public statement of acceptance of a version permanently 1204 authorizes you to choose that version for the Document. 1205 1206 11. RELICENSING 1207 1208 "Massive Multiauthor Collaboration Site" (or "MMC Site") means any 1209 World Wide Web server that publishes copyrightable works and also 1210 provides prominent facilities for anybody to edit those works. A 1211 public wiki that anybody can edit is an example of such a server. 1212 A "Massive Multiauthor Collaboration" (or "MMC") contained in the 1213 site means any set of copyrightable works thus published on the MMC 1214 site. 1215 1216 "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 1217 license published by Creative Commons Corporation, a not-for-profit 1218 corporation with a principal place of business in San Francisco, 1219 California, as well as future copyleft versions of that license 1220 published by that same organization. 1221 1222 "Incorporate" means to publish or republish a Document, in whole or 1223 in part, as part of another Document. 1224 1225 An MMC is "eligible for relicensing" if it is licensed under this 1226 License, and if all works that were first published under this 1227 License somewhere other than this MMC, and subsequently 1228 incorporated in whole or in part into the MMC, (1) had no cover 1229 texts or invariant sections, and (2) were thus incorporated prior 1230 to November 1, 2008. 1231 1232 The operator of an MMC Site may republish an MMC contained in the 1233 site under CC-BY-SA on the same site at any time before August 1, 1234 2009, provided the MMC is eligible for relicensing. 1235 1236 ADDENDUM: How to use this License for your documents 1237 ==================================================== 1238 1239 To use this License in a document you have written, include a copy of 1240 the License in the document and put the following copyright and license 1241 notices just after the title page: 1242 1243 Copyright (C) YEAR YOUR NAME. 1244 Permission is granted to copy, distribute and/or modify this document 1245 under the terms of the GNU Free Documentation License, Version 1.3 1246 or any later version published by the Free Software Foundation; 1247 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 1248 Texts. A copy of the license is included in the section entitled ``GNU 1249 Free Documentation License''. 1250 1251 If you have Invariant Sections, Front-Cover Texts and Back-Cover 1252 Texts, replace the "with...Texts." line with this: 1253 1254 with the Invariant Sections being LIST THEIR TITLES, with 1255 the Front-Cover Texts being LIST, and with the Back-Cover Texts 1256 being LIST. 1257 1258 If you have Invariant Sections without Cover Texts, or some other 1259 combination of the three, merge those two alternatives to suit the 1260 situation. 1261 1262 If your document contains nontrivial examples of program code, we 1263 recommend releasing these examples in parallel under your choice of free 1264 software license, such as the GNU General Public License, to permit 1265 their use in free software. 1266 1267 1268 File: gccgo.info, Node: Invoking gccgo, Next: Import and Export, Prev: GNU Free Documentation License, Up: Top 1269 1270 1 Invoking gccgo 1271 **************** 1272 1273 The 'gccgo' command is a frontend to 'gcc' and supports many of the same 1274 options. *Note Option Summary: (gcc)Option Summary. This manual only 1275 documents the options specific to 'gccgo'. 1276 1277 The 'gccgo' command may be used to compile Go source code into an 1278 object file, link a collection of object files together, or do both in 1279 sequence. 1280 1281 Go source code is compiled as packages. A package consists of one or 1282 more Go source files. All the files in a single package must be 1283 compiled together, by passing all the files as arguments to 'gccgo'. A 1284 single invocation of 'gccgo' may only compile a single package. 1285 1286 One Go package may 'import' a different Go package. The imported 1287 package must have already been compiled; 'gccgo' will read the import 1288 data directly from the compiled package. When this package is later 1289 linked, the compiled form of the package must be included in the link 1290 command. 1291 1292 Go programs must generally be compiled with debugging information, 1293 and '-g1' is the default as described below. Stripping a Go program 1294 will generally cause it to misbehave or fail. 1295 1296 '-IDIR' 1297 Specify a directory to use when searching for an import package at 1298 compile time. 1299 1300 '-LDIR' 1301 When linking, specify a library search directory, as with 'gcc'. 1302 1303 '-fgo-pkgpath=STRING' 1304 Set the package path to use. This sets the value returned by the 1305 PkgPath method of reflect.Type objects. It is also used for the 1306 names of globally visible symbols. The argument to this option 1307 should normally be the string that will be used to import this 1308 package after it has been installed; in other words, a pathname 1309 within the directories specified by the '-I' option. 1310 1311 '-fgo-prefix=STRING' 1312 An alternative to '-fgo-pkgpath'. The argument will be combined 1313 with the package name from the source file to produce the package 1314 path. If '-fgo-pkgpath' is used, '-fgo-prefix' will be ignored. 1315 1316 Go permits a single program to include more than one package with 1317 the same name in the 'package' clause in the source file, though 1318 obviously the two packages must be imported using different 1319 pathnames. In order for this to work with 'gccgo', either 1320 '-fgo-pkgpath' or '-fgo-prefix' must be specified when compiling a 1321 package. 1322 1323 Using either '-fgo-pkgpath' or '-fgo-prefix' disables the special 1324 treatment of the 'main' package and permits that package to be 1325 imported like any other. 1326 1327 '-fgo-relative-import-path=DIR' 1328 A relative import is an import that starts with './' or '../'. If 1329 this option is used, 'gccgo' will use DIR as a prefix for the 1330 relative import when searching for it. 1331 1332 '-frequire-return-statement' 1333 '-fno-require-return-statement' 1334 By default 'gccgo' will warn about functions which have one or more 1335 return parameters but lack an explicit 'return' statement. This 1336 warning may be disabled using '-fno-require-return-statement'. 1337 1338 '-fgo-check-divide-zero' 1339 Add explicit checks for division by zero. In Go a division (or 1340 modulos) by zero causes a panic. On Unix systems this is detected 1341 in the runtime by catching the 'SIGFPE' signal. Some processors, 1342 such as PowerPC, do not generate a SIGFPE on division by zero. 1343 Some runtimes do not generate a signal that can be caught. On 1344 those systems, this option may be used. Or the checks may be 1345 removed via '-fno-go-check-divide-zero'. This option is currently 1346 on by default, but in the future may be off by default on systems 1347 that do not require it. 1348 1349 '-fgo-check-divide-overflow' 1350 Add explicit checks for division overflow. For example, division 1351 overflow occurs when computing 'INT_MIN / -1'. In Go this should 1352 be wrapped, to produce 'INT_MIN'. Some processors, such as x86, 1353 generate a trap on division overflow. On those systems, this 1354 option may be used. Or the checks may be removed via 1355 '-fno-go-check-divide-overflow'. This option is currently on by 1356 default, but in the future may be off by default on systems that do 1357 not require it. 1358 1359 '-fno-go-optimize-allocs' 1360 Disable escape analysis, which tries to allocate objects on the 1361 stack rather than the heap. 1362 1363 '-fgo-debug-escapeN' 1364 Output escape analysis debugging information. Larger values of N 1365 generate more information. 1366 1367 '-fgo-debug-escape-hash=N' 1368 A hash value to debug escape analysis. N is a binary string. This 1369 runs escape analysis only on functions whose names hash to values 1370 that match the given suffix N. This can be used to binary search 1371 across functions to uncover escape analysis bugs. 1372 1373 '-fgo-debug-optimization' 1374 Output optimization diagnostics. 1375 1376 '-fgo-c-header=FILE' 1377 Write top-level named Go struct definitions to FILE as C code. 1378 This is used when compiling the runtime package. 1379 1380 '-fgo-compiling-runtime' 1381 Apply special rules for compiling the runtime package. Implicit 1382 memory allocation is forbidden. Some additional compiler 1383 directives are supported. 1384 1385 '-fgo-embedcfg=FILE' 1386 Identify a JSON file used to map patterns used with special 1387 '//go:embed' comments to the files named by the patterns. The JSON 1388 file should have two components: 'Patterns' maps each pattern to a 1389 list of file names, and 'Files' maps each file name to a full path 1390 to the file. This option is intended for use by the 'go' command 1391 to implement '//go:embed'. 1392 1393 '-g' 1394 This is the standard 'gcc' option (*note Debugging Options: 1395 (gcc)Debugging Options.). It is mentioned here because by default 1396 'gccgo' turns on debugging information generation with the 1397 equivalent of the standard option '-g1'. This is because Go 1398 programs require debugging information to be available in order to 1399 get backtrace information. An explicit '-g0' may be used to 1400 disable the generation of debugging information, in which case 1401 certain standard library functions, such as 'runtime.Callers', will 1402 not operate correctly. 1403 1404 1405 File: gccgo.info, Node: Import and Export, Next: Compiler Directives, Prev: Invoking gccgo, Up: Top 1406 1407 2 Import and Export 1408 ******************* 1409 1410 When 'gccgo' compiles a package which exports anything, the export 1411 information will be stored directly in the object file. When a package 1412 is imported, 'gccgo' must be able to find the file. 1413 1414 When Go code imports the package 'GOPACKAGE', 'gccgo' will look for 1415 the import data using the following filenames, using the first one that 1416 it finds. 1417 1418 'GOPACKAGE.gox' 1419 'libGOPACKAGE.so' 1420 'libGOPACKAGE.a' 1421 'GOPACKAGE.o' 1422 1423 The compiler will search for these files in the directories named by 1424 any '-I' options, in order in which the directories appear on the 1425 command line. The compiler will then search several standard system 1426 directories. Finally the compiler will search the current directory (to 1427 search the current directory earlier, use '-I.'). 1428 1429 The compiler will extract the export information directly from the 1430 compiled object file. The file 'GOPACKAGE.gox' will typically contain 1431 nothing but export data. This can be generated from 'GOPACKAGE.o' via 1432 1433 objcopy -j .go_export GOPACKAGE.o GOPACKAGE.gox 1434 1435 For example, it may be desirable to extract the export information 1436 from several different packages into their independent 'GOPACKAGE.gox' 1437 files, and then to combine the different package object files together 1438 into a single shared library or archive. 1439 1440 At link time you must explicitly tell 'gccgo' which files to link 1441 together into the executable, as is usual with 'gcc'. This is different 1442 from the behavior of other Go compilers. 1443 1444 1445 File: gccgo.info, Node: Compiler Directives, Next: C Interoperability, Prev: Import and Export, Up: Top 1446 1447 3 Compiler Directives 1448 ********************* 1449 1450 The Go compiler supports a few compiler directives. A compiler 1451 directive uses a '//' comment at the start of a line. There must be no 1452 space between the '//' and the name of the directive. 1453 1454 '//line FILE:LINE' 1455 The '//line' directive specifies that the source line that follows 1456 should be recorded as having come from the given file path and line 1457 number. Successive lines are recorded using increasing line 1458 numbers, until the next directive. This directive typically 1459 appears in machine-generated code, so that compilers and debuggers 1460 will show lines in the original input to the generator. 1461 1462 '//extern EXTERN_NAME' 1463 The 'extern' directive sets the externally visible name of the next 1464 function declaration. See *note Function Names::. 1465 1466 '//go:compile GO_NAME EXTERN_NAME' 1467 The 'go:compile' directives sets the externally visible name of a 1468 function definition or declaration. See *note Function Names::. 1469 1470 '//go:noescape' 1471 The '//go:noescape' directive specifies that the next declaration 1472 in the file, which must be a func without a body (meaning that it 1473 has an implementation not written in Go) does not allow any of the 1474 pointers passed as arguments to escape into the heap or into the 1475 values returned from the function. This information can be used 1476 during the compiler's escape analysis of Go code calling the 1477 function. 1478 1479 '//go:nosplit' 1480 The '//go:nosplit' directive specifies that the next function 1481 declared in the file must not include a stack overflow check. This 1482 is most commonly used by low-level runtime sources invoked at times 1483 when it is unsafe for the calling goroutine to be preempted. 1484 1485 '//go:noinline' 1486 The '//go:noinline' directive specifies that the next function 1487 defined in the file may not be inlined. 1488 1489 1490 File: gccgo.info, Node: C Interoperability, Next: Index, Prev: Compiler Directives, Up: Top 1491 1492 4 C Interoperability 1493 ******************** 1494 1495 When using 'gccgo' there is limited interoperability with C, or with C++ 1496 code compiled using 'extern "C"'. 1497 1498 This information is provided largely for documentation purposes. For 1499 ordinary use it is best to build programs with the go tool and then use 1500 'import "C"', as described at <https://golang.org/cmd/cgo>. 1501 1502 * Menu: 1503 1504 * C Type Interoperability:: How C and Go types match up. 1505 * Function Names:: How Go functions are named. 1506 1507 1508 File: gccgo.info, Node: C Type Interoperability, Next: Function Names, Up: C Interoperability 1509 1510 4.1 C Type Interoperability 1511 =========================== 1512 1513 Basic types map directly: an 'int' in Go is an 'int' in C, etc. Go 1514 'byte' is equivalent to C 'unsigned char'. Pointers in Go are pointers 1515 in C. A Go 'struct' is the same as C 'struct' with the same field names 1516 and types. 1517 1518 The Go 'string' type is currently defined as a two-element structure: 1519 1520 struct __go_string { 1521 const unsigned char *__data; 1522 int __length; 1523 }; 1524 1525 You can't pass arrays between C and Go. However, a pointer to an 1526 array in Go is equivalent to a C pointer to the equivalent of the 1527 element type. For example, Go '*[10]int' is equivalent to C 'int*', 1528 assuming that the C pointer does point to 10 elements. 1529 1530 A slice in Go is a structure. The current definition is: 1531 1532 struct __go_slice { 1533 void *__values; 1534 int __count; 1535 int __capacity; 1536 }; 1537 1538 The type of a Go function with no receiver is equivalent to a C 1539 function whose parameter types are equivalent. When a Go function 1540 returns more than one value, the C function returns a struct. For 1541 example, these functions have equivalent types: 1542 1543 func GoFunction(int) (int, float) 1544 struct { int i; float f; } CFunction(int) 1545 1546 A pointer to a Go function is equivalent to a pointer to a C function 1547 when the functions have equivalent types. 1548 1549 Go 'interface', 'channel', and 'map' types have no corresponding C 1550 type ('interface' is a two-element struct and 'channel' and 'map' are 1551 pointers to structs in C, but the structs are deliberately 1552 undocumented). C 'enum' types correspond to some integer type, but 1553 precisely which one is difficult to predict in general; use a cast. C 1554 'union' types have no corresponding Go type. C 'struct' types 1555 containing bitfields have no corresponding Go type. C++ 'class' types 1556 have no corresponding Go type. 1557 1558 Memory allocation is completely different between C and Go, as Go 1559 uses garbage collection. The exact guidelines in this area are 1560 undetermined, but it is likely that it will be permitted to pass a 1561 pointer to allocated memory from C to Go. The responsibility of 1562 eventually freeing the pointer will remain with C side, and of course if 1563 the C side frees the pointer while the Go side still has a copy the 1564 program will fail. When passing a pointer from Go to C, the Go function 1565 must retain a visible copy of it in some Go variable. Otherwise the Go 1566 garbage collector may delete the pointer while the C function is still 1567 using it. 1568 1569 1570 File: gccgo.info, Node: Function Names, Prev: C Type Interoperability, Up: C Interoperability 1571 1572 4.2 Function Names 1573 ================== 1574 1575 Go code can call C functions directly using the '//extern' or 1576 '//go:linkname' compiler directives. An '//extern' directive must be at 1577 the beginning of the line and must start with '//extern'. This must be 1578 followed by a space and then the external name of the function. The 1579 function declaration must be on the line immediately after the comment. 1580 For example, here is how the C function 'open' can be declared in Go: 1581 1582 //extern open 1583 func c_open(name *byte, mode int, perm int) int 1584 1585 You can do the same thing using the '//go:linkname' compiler 1586 directive. The '//go:linkname' directive must be at the start of the 1587 line. It is followed by whitespace, the name of the Go function, more 1588 whitespace, and the external name of the function. Unlike '//extern', 1589 '//go:linkname' does not need to appear immediately adjacent to the 1590 function definition or declaration. 1591 1592 //go:linkname c_open open 1593 func c_open(name *byte, mode int, perm int) int 1594 1595 The C function naturally expects a nul terminated string, which in Go 1596 is equivalent to a pointer to an array (not a slice!) of 'byte' with a 1597 terminating zero byte. So a sample call from Go would look like (after 1598 importing the 'os' package): 1599 1600 var name = [4]byte{'f', 'o', 'o', 0}; 1601 i := c_open(&name[0], os.O_RDONLY, 0); 1602 1603 Note that this serves as an example only. To open a file in Go 1604 please use Go's 'os.Open' function instead. 1605 1606 The name of Go functions accessed from C is subject to change. At 1607 present the name of a Go function that does not have a receiver is 1608 'pkgpath.Functionname'. The PKGPATH is set by the '-fgo-pkgpath' option 1609 used when the package is compiled; if the option is not used, the 1610 default is 'go.PACKAGENAME'. To call the function from C you must set 1611 the name using the 'gcc' '__asm__' extension. 1612 1613 extern int go_function(int) __asm__ ("mypkgpath.Function"); 1614 1615 1616 File: gccgo.info, Node: Index, Prev: C Interoperability, Up: Top 1617 1618 Index 1619 ***** 1620 1621 [index] 1622 * Menu: 1623 1624 * -fgo-c-header: Invoking gccgo. (line 110) 1625 * -fgo-check-divide-overflow: Invoking gccgo. (line 83) 1626 * -fgo-check-divide-zero: Invoking gccgo. (line 72) 1627 * -fgo-compiling-runtime: Invoking gccgo. (line 114) 1628 * -fgo-debug-escape: Invoking gccgo. (line 97) 1629 * -fgo-debug-escape-hash: Invoking gccgo. (line 101) 1630 * -fgo-debug-optimization: Invoking gccgo. (line 107) 1631 * -fgo-embedcfg: Invoking gccgo. (line 119) 1632 * -fgo-pkgpath: Invoking gccgo. (line 37) 1633 * -fgo-prefix: Invoking gccgo. (line 45) 1634 * -fgo-relative-import-path: Invoking gccgo. (line 61) 1635 * -fno-go-check-divide-overflow: Invoking gccgo. (line 83) 1636 * -fno-go-check-divide-zero: Invoking gccgo. (line 72) 1637 * -fno-go-debug-optimization: Invoking gccgo. (line 107) 1638 * -fno-go-optimize-allocs: Invoking gccgo. (line 93) 1639 * -fno-require-return-statement: Invoking gccgo. (line 67) 1640 * -frequire-return-statement: Invoking gccgo. (line 67) 1641 * -g for gccgo: Invoking gccgo. (line 127) 1642 * -I: Invoking gccgo. (line 30) 1643 * -L: Invoking gccgo. (line 34) 1644 * .gox: Import and Export. (line 10) 1645 * extern: Function Names. (line 6) 1646 * external names: Function Names. (line 6) 1647 * FDL, GNU Free Documentation License: GNU Free Documentation License. 1648 (line 6) 1649 * slice in C: C Type Interoperability. 1650 (line 23) 1651 * string in C: C Type Interoperability. 1652 (line 11) 1653 1654 1655 1656 Tag Table: 1657 Node: Top1688 1658 Node: Copying2548 1659 Node: GNU Free Documentation License40084 1660 Node: Invoking gccgo65214 1661 Node: Import and Export71394 1662 Node: Compiler Directives72990 1663 Node: C Interoperability74974 1664 Node: C Type Interoperability75561 1665 Node: Function Names78120 1666 Node: Index80124 1667 1668 End Tag Table 1669