1<?xml version="1.0" ?> 2<gprconfig> 3 <!-- This differs from the default GNAT compiler description 4 in the following ways: 5 6 * gnatmake is used over gnatls to detect the GNAT version 7 since the latter is not part of the wrapper. 8 * to find the runtime libraries, we rely on the symlink 9 ../nix-support/gprconfig-gnat-unwrapped which is a 10 gprconfig-specific addition to the cc-wrapper we employ 11 for Ada compilers (which is only GNAT at the moment). 12 13 For documentation on this file format and its use refer to 14 https://docs.adacore.com/gprbuild-docs/html/gprbuild_ug/companion_tools.html#the-gprconfig-knowledge-base 15 --> 16 <compiler_description> 17 <!-- We would like to name this something different, so users 18 of gprconfig know this is something custom, nixpkgs-related, 19 but unfortunately the knowledge base depends on the name of 20 the compiler for e. g. linker settings. 21 --> 22 <name>GNAT</name> 23 <executable prefix="1">(.*-.*-.*)?gnatmake</executable> 24 <version> 25 <external>${PREFIX}gnatmake -v</external> 26 <grep regexp="^GNATMAKE.+?(\d+(\.\d+)?)" group="1"></grep> 27 </version> 28 <languages>Ada</languages> 29 <variable name="gcc_version"> 30 <external>${PREFIX}gcc -v</external> 31 <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep> 32 </variable> 33 <!-- The ada runtime libraries and objects are only part of the unwrapped 34 GNAT derivation. We can't symlink them into the wrapper derivation 35 (at least not the canonical location) since that screws with linking 36 against libraries distributed with gcc. 37 38 As a workaround, we create a symlink to the unwrapped GNAT's "out" 39 output in the cc-wrapper which we can read into a variable here and 40 use to find GNAT's Ada runtime. 41 --> 42 <variable name="gnat_unwrapped"> 43 <external>readlink -n ${PATH}/../nix-support/gprconfig-gnat-unwrapped</external> 44 </variable> 45 <runtimes default="default,kernel,native"> 46 <directory group="default" >$gnat_unwrapped/lib/gcc(-lib)?/$TARGET/$gcc_version/adalib/</directory> 47 <directory group="default" contents="^rts-">$gnat_unwrapped/lib/gcc(-lib)?/$TARGET/$gcc_version/ada_object_path</directory> 48 <directory group="2" >$gnat_unwrapped/lib/gcc(-lib)?/$TARGET/$gcc_version/rts-(.*)/adalib/</directory> 49 <directory group="1" >$gnat_unwrapped/$TARGET/lib/gnat/(.*)/adalib/</directory> 50 </runtimes> 51 <target> 52 <external>${PREFIX}gcc -dumpmachine</external> 53 <grep regexp="[^\r\n]+"></grep> 54 </target> 55 </compiler_description> 56 <configuration> 57 <!-- aarch64-linux - native compiler. --> 58 <targets> 59 <target name="^aarch64-unknown-linux-gnu$" /> 60 </targets> 61 <hosts> 62 <host name="^aarch64-unknown-linux-gnu$" /> 63 </hosts> 64 <config> 65 for Archive_Builder use ("ar", "cr"); 66 for Archive_Builder_Append_Option use ("q"); 67 for Archive_Indexer use ("ranlib"); 68 for Archive_Suffix use ".a"; 69 </config> 70 </configuration> 71 <configuration> 72 <!-- aarch64-linux - native compiler. --> 73 <targets> 74 <target name="^aarch64-unknown-linux-gnu$" /> 75 </targets> 76 <hosts> 77 <host name="^aarch64-unknown-linux-gnu$" /> 78 </hosts> 79 <config> 80 for Object_Lister use ("nm", "-g"); 81 for Object_Lister_Matcher use " [TDRBSG] (.*)"; 82 83 package Linker is 84 for Export_File_Format use "GNU"; 85 for Export_File_Switch use "-Wl,--version-script="; 86 end Linker; 87 </config> 88 </configuration> 89</gprconfig>