From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c815b1e8d3500c86,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g14g2000cwa.googlegroups.com!not-for-mail From: "Craig Carey " Newsgroups: comp.lang.ada Subject: FreeBSD Linuxulator runs GNAT Date: 2 Sep 2005 09:02:16 -0700 Organization: http://groups.google.com Message-ID: <1125676936.625281.324050@g14g2000cwa.googlegroups.com> NNTP-Posting-Host: 210.185.8.191 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1125676941 7866 127.0.0.1 (2 Sep 2005 16:02:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 2 Sep 2005 16:02:21 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g14g2000cwa.googlegroups.com; posting-host=210.185.8.191; posting-account=VAk6zg0AAAAB8m7bE8j11Y9JsY1KL2hL Xref: g2news1.google.com comp.lang.ada:4404 Date: 2005-09-02T09:02:16-07:00 List-Id: Getting Ada programs compiled inside of the FreeBSD Linuxulator The FreeBSD Ada Port seems to not run or install or something. Here is how to compile a Linux gnatmake inside of FreeBSD and have it run under the Linux emulator. The main trick here is to add this to the compiler options: -largs -static -Wl,--sysroot=/usr/compat/linux Linux GNAT programs seem to run correctly in the FreeBSD Linuxulator. ------------------------------------------------------------------- (4) In FreeBSD, after the following steps are done: To get gnatmake to run, this can be added -bargs -E -p -we -s -F -largs -v -v -static -Wl,--sysroot=/usr/compat/linux -Wl,--verbose gnatmake myprog.adb ..... # >| xx 2>&1 brandelf -t Linux myprog # Failed to eliminate the use of brandelf The -Wl,--verbose seems useful. It lists all /lib files that are used. Use of any FreeBSD *.a file can ruin the executable. ------------------------------------------------------------------- (1) In FreeBSD ** Install a Linux emulator. That involves getting the kernel configured appropriately. ** Install ports/archives/rpm2cpio ** Get the development libc file that matches the other Linuxulator files, to supply libpthread.a. E.g. download the next from rmpfind.net: glibc-devel-2.3.2-27.9.7.i386.rpm ** If the Linux rpm was used then the command might look like this: rpm -i --ignoreos --root /usr/compat/linux --dbpath /var/lib/rpm $@ (That install would copy over too much documentation or fail since Linux kernel headers are missing.) rpm2cpio < glibc-devel-2.3.2-27.9.7.i386.rpm >| xx cpio -idm < xx # create directories with original time stamps The "cp -pv" files into /usr/compat/linux/usr/lib/ ------------------------------------------------------------------- (2) In Linux, build FSF gcc Download gcc: http://gcc.gnu.org/install/download.html export CVS_RSH=ssh export CVSROOT=:ext:anoncvs@savannah.gnu.org:/cvsroot/gcc cvs -z9 checkout -P gcc Compile up GCC. It seems that version 4.1.0 has bugs and it is not expected to run correctly, so GCC 3.4.4 can be used. export PATH=/lxg/gcc1/bin:$PATH cd obj /fu/@gcc/344/gcc/configure \ --prefix=/lxg/gcc344 \ --enable-languages="c,c++,ada" \ --enable-libada \ --with-gcc --with-gnu-ld --with-gnu-as \ --enable-threads=posix \ --disable-shared \ --with-system-zlib \ --disable-nls \ --disable-multilib \ --disable-libssp nice make STAGE1_CFLAGS='-O0' BOOT_CFLAGS='-O0' bootstrap make -C gcc gnatlib_and_tools # try this? make -C gcc/ada gnatlib # try this? make install ------------------------------------------------------------------- (3) In Linux, build Redhat binutils. A version new enough to have the --sysroot feature, is needed. http://sourceware.org/binutils/ export CVSROOT=:pserver:anoncvs@sourceware.org:/cvs/src # Password is "anoncvs", "anonymous"? cvs -z9 login cvs -z9 co binutils cd / ; ln -s / lxsys # /lxsys is not used again so presumably "/" could be used instead export PATH=/lxg/gcc344/bin:$PATH_SAVED export LD_LIBRARY_PATH=/lxg/gcc344/lib:$LD_LIBRARY_PATH # the build modifies the source directory so it might be copied. cd obj lxg/@redhat/src/configure \ --prefix=/lxg/gcc344 \ --with-build-sysroot=/lxsys \ --with-sysroot=/lxsys \ --enable-static=yes \ --enable-languages=c,c++,ada \ --enable-libada \ --with-gcc --with-gnu-ld --with-gnu-as \ --enable-threads=posix \ --disable-shared \ --with-system-zlib \ --disable-nls \ --disable-multilib \ --disable-libssp Then maybe the Suse Gvd or whatever, might be used as the debugger. In Windows, the Gdb debuger of GNAT 3.15p can't handle some Cygwin paths and ver "gdb-5.3" of http://libre.act-europe.fr/GDB/ can fix that (AdaCore names only 6.3, and maybe that is not better) ------------------------------------------------------------------- The above message could have gone to these mailing lists: GNATLIST: http://hermes.gwu.edu/archives/gnatlist.html GCC-Help: http://gcc.gnu.org/lists.html The ARG (run from St Quentin France) is apparently still lacking the thrusting power to get its "arg@ada-auth.org" mailing list to lift off into the night sky of real-time dissemination of information in accordance with deadlines for delays that are under 1.5 minutes ... --------- Here is promotion for running FreeBSD inside of some Windows OS, e.g. from P2P: NAT connection and the VMware filesharing, FreeBSD guest: http://www.ijs.co.nz/unix.htm http://www.ijs.co.nz/code/unix-etc-files.zip Here are my notes on how to create a defective native FreeBSD cross compiler that targets Linux: http://www.ijs.co.nz/code/ada95-freebsd-to-linux-cross-compiler.txt Craig Carey, Auckland city, research@ijs.co.nz