From owner-freebsd-arm@freebsd.org Sun May 22 23:55:09 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26FCEB4660A for ; Sun, 22 May 2016 23:55:09 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D42011F47 for ; Sun, 22 May 2016 23:55:08 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: by mail-qg0-x236.google.com with SMTP id 90so82701530qgz.1 for ; Sun, 22 May 2016 16:55:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=ye9yF6cA/AFFHXS1Qh59BQHHsF8XwQZChr35Qg7Y4vs=; b=dqXW90T2oR5tuoFdQH5vQj8QnMbjojYjbvpKTQByFcuTz4/p7afbgwSEYGbxseVoPy uPQor5PfQS1hXoDzDVWzZC8xmNEkQIJS7O8KKdSY9OFPnJzcnKbpFAu7Q5UbHyQbk7Fq 7qPozahWSxvzoq3nHOCWlDx7H3Zb+v/BmxSEw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=ye9yF6cA/AFFHXS1Qh59BQHHsF8XwQZChr35Qg7Y4vs=; b=TToBdUhMxPLGOe7hK465a7IAgDgge0QlIRdoVO2lnW40XkArlUpwW+GbzejiJPMcHz kceEuipDxh0laLEPiA7dkfpMSjlNnmYPfp8S+m2zuR9BFE/l5CFOapCQI6vXg0nUVIks 6jukRLX7JwjDiCBJv/EPFKYcS7pVpSRTeWUi2ZKmiajaGNPNM7QMKMKTCmAG0hOfHk9L RU0H+ifGk9BXuwrMuHzKIfhJShgCBGgRJiNYdbzMQPEMSOOr6XAcS4L/RtnousVOXyES QL2229Uz5utJ7K7jR9AM2zOkiN+LMBBtfe0v/37bGdM5XgoKnirMJHt62GszPzwQyJ+w oFHQ== X-Gm-Message-State: AOPr4FUxlwl7w5n36UM24KVr9tcyesbBWWhTUvlZWrnX6ii3ZYVzz4S51tPmIFmij8HCaQ== X-Received: by 10.140.21.242 with SMTP id 105mr12649700qgl.50.1463961307348; Sun, 22 May 2016 16:55:07 -0700 (PDT) Received: from [192.168.0.18] ([187.60.94.34]) by smtp.googlemail.com with ESMTPSA id l65sm1473194qhb.36.2016.05.22.16.55.05 for (version=TLSv1/SSLv3 cipher=OTHER); Sun, 22 May 2016 16:55:06 -0700 (PDT) Subject: Re: How do you guys cross compile for Zynq (Cortex A9)? To: freebsd-arm@freebsd.org References: From: =?UTF-8?B?T3RhY8OtbGlv?= Message-ID: <53cdb1c9-8732-eecc-bb17-503a8200fffd@bsd.com.br> Date: Sun, 22 May 2016 20:54:58 -0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 23:55:09 -0000 Em 22/05/2016 15:48, Emb Aud escreveu: > Hi Everyone, > > I've got FreeBSD compiled and running on my Zybo (Xilinx Zynq CPU). > > But I can't figure out how to compile programs to run on it. > > I've gone round and round with teh gcc-arm-embedded-5.2.20151219_1 > package, and also with the arm-none-eabi-gcc* packages. Nothing seem to > work and there is almost no documentation on this. > > It also looks like the Cortex A9 is armv7-a, but the FreeBSD compile > instructions I've found (and that work) are for armv6. > > My first problem was not finding the stdio.h header when I tried to > compile. I solved that by switching to the gcc-arm-embedded package. Now > when I compile it finds the header but it barfs on libc.a... With errors > like "undefined reference to `_exit'" and other very basic libc functions. > > Can anyone tell me how you are compiling your Zynq programs? > > Thank you. > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" Dear I have a Beaglebone Black and I'm using my i7 to cross compile packages for beaglebone. The procedure that I'm using is the follow: 1. Update the FreeBSD cross compiler machine to FreeBSD 11. 2. Install poudriere from ports, so you must enable "QEMU Add qemu-user-static to compile ports for non-x86 architect". Remember to start qemu after install and add to /etc/rc.conf 3. The first time that I have installed qemu I ran the follow line, but it not clear for me if this still necessary, but the command is the follow: |# binmiscctl add armv6 --interpreter "/usr/local/bin/qemu-arm-static" --magic "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00" --mask "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" --size 20 --set-enabled 4. I run uname -a to see the revision of my freebsd box and then I run: | # poudriere jail -x -c -j 110armv6 -a arm.armv6 -m svn -v head@300438 This will take a lot of time. where you can replace 300438 by the revision that you are using. The -x flag is very important to poudriere run native tools (like clang) when available to improve compiler time. When I update the jail I use -x also. 5. Checkout the ports tree. I do it with: # poudriere ports -c -f poudriere/ports/110armv6 -p 110armv6 -m svn So, when I need update the ports tree I run cd /usr/local/poudriere/ports/110armv6/ and svnlite up -r 6. Edit a file with the ports that you want compile. For example: sysutils/tmux sysutils/screen sysutils/usbutils net/vnstat multimedia/webcamd multimedia/ffmpeg benchmarks/iperf devel/git multimedia/v4l-utils multimedia/pwcview and save bbb-pkg_plist 7. Configure ports options: # poudriere options -c -f bbb-pkg_plist -j 110armv6 8. Start the build: # poudriere bulk -j 110armv6 -p 110armv6 -v -f bbb-pkg_plist 9. Poudriere dumps lots of log. You can use a browser to see the build work. To this install nginx (/usr/ports/www/nginx). Add this to section http of /usr/local/etc/nginx/nginx.conf . I will show the full http entry. My machine name is nostromo: http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 0.0.0.0:8080; server_name nostromo; root /usr/local/share/poudriere/html; # Allow caching static resources location ~* ^.+\.(jpg|jpeg|gif|png|ico|svg|woff|css|js|html)$ { add_header Cache-Control "public"; expires 2d; } location /data { alias /usr/local/poudriere/data/logs/bulk; # Allow caching dynamic files but ensure they get rechecked location ~* ^.+\.(log|txz|tbz|bz2|gz)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } # Don't log json requests as they come in frequently and ensure # caching works as expected location ~* ^.+\.(json)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate"; access_log off; log_not_found off; } # Allow indexing only in log dirs location ~ /data/?.*/(logs|latest-per-pkg)/ { autoindex on; } break; } location /repo { alias /usr/local/poudriere/data/packages; autoindex on; } } } 10. Edit file /usr/local/etc/nginx/mime.types and to text/plain enter add log: text/plain txt log; 11. And start nginx: # /usr/local/etc/rc.d/nginx start Now you can follow the build. open in your browser the http://:8080 12. While poudriere compile the ports it is necessary configure beaglebone to use your machine like a package repo. I do it doing two things in Beaglebone. First I run this command: |# mkdir -p /usr/local/etc/pkg/repos # echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf 13. Then edit ||/usr/local/etc/pkg/repos/nostromo.conf . Remember, nostromo is my cross compile machine, replace by yours machine. I Add this lines: ||nostromo: { url: "pkg+http://nostromo:8080/repo/110armv6-110armv6/.latest", mirror_type: "srv", enabled: yes } 14. Edit /etc/hosts in your beaglebone and add the ip of your build machine. When build ends you can install packages with pkg install . So all times that I wrote beaglebone you can replace by your board :) . I follow this procedure by the first time from this link: https://www.textplain.net/tutorials/2015/cross-compiling-freebsd-ports-for-the-beaglebone-black/ But I have modified some things. |||I hope that this can help you.| []'s -Otacílio |