From owner-freebsd-arm@freebsd.org Mon May 23 03:34:31 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 575DDB464CF for ; Mon, 23 May 2016 03:34:31 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: from mail-oi0-x236.google.com (mail-oi0-x236.google.com [IPv6:2607:f8b0:4003:c06::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 1B64C1B7C for ; Mon, 23 May 2016 03:34:31 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: by mail-oi0-x236.google.com with SMTP id x19so258989772oix.2 for ; Sun, 22 May 2016 20:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=k4qUvE0QfyyHm6xQCzeXTUApNPyviCnZ8St+TiN217Y=; b=DXBE1rL7gaZhXjzbxBLRylZPnJSYYWnoO2bzm1ABBlJUZBwzjpvyQs2ZGwosBzgrqA F4IYhmP0v+AX4fSGRerDRVqLM43qyHcDNLh2LhrhIC9x390NrBedOxNSJrf00ZFhNeVZ 30Xm6OucXZ5WGd4Sy7U8JhwNMmz42jq4TmuzVxbbbu0YdT18+ZffshhGiP7xMJ6uOOvQ ndudUdzCji5v9rDDqTn3V2JMIoHD2YvZQH6HzZqigG6WEn/jXa3qyySsUrZAYUgW0/2d VNFMSiCw3tEJWVqixkk/9qmeiYiAia6DG9uu5vkxRFA9Bwwyh212rsm3DAcgLJlM4R3P /wIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=k4qUvE0QfyyHm6xQCzeXTUApNPyviCnZ8St+TiN217Y=; b=LrCwITORbBb6BSbtKY7gVXRKKmmq0btNkPbI2L3/x+WRijI0gU0Om7VnUpoptVjlfv HYpDGLG/Euxb9YcqGPFmGb2wFmfbKIs5lvSKr1sZHrj0Z9dJrLKjyNvo8HO96ITKUEFS sEYC6NT6nX12278AkHOaZ8cfUTw42Gs+rzidXmCbKPSPidp6g7BlEzNXhsZBV0o4r7DL d6Dgx9miedaOg/ZsM9ZTaCW1aLI/fcZQVRAXZVpiUHAvEDJqUDnKUn1DL+32IKMKj5p+ mCJLDyT2ud0+65ewvxjivxxlDtbyaU1FhQGjrGIW0AYx1edjO0dg5fQAu7195y3RQk5D GrVw== X-Gm-Message-State: AOPr4FVWPuRLIky79lNQxXya0jKiKuljBiPCm6gsOAE7kFWw5HxxRq5cQUwyb6KF9w6yZaGlAC9Yb7PuoJ0UiQ== MIME-Version: 1.0 X-Received: by 10.202.62.215 with SMTP id l206mr8217276oia.19.1463974470385; Sun, 22 May 2016 20:34:30 -0700 (PDT) Received: by 10.157.20.8 with HTTP; Sun, 22 May 2016 20:34:30 -0700 (PDT) In-Reply-To: <53cdb1c9-8732-eecc-bb17-503a8200fffd@bsd.com.br> References: <53cdb1c9-8732-eecc-bb17-503a8200fffd@bsd.com.br> Date: Sun, 22 May 2016 23:34:30 -0400 Message-ID: Subject: Re: How do you guys cross compile for Zynq (Cortex A9)? From: Emb Aud To: =?UTF-8?B?T3RhY8OtbGlv?= Cc: freebsd-arm Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Mon, 23 May 2016 03:34:31 -0000 Interesting. When it comes time to build some ports (I'm sure I'll want to eventually), I will give this a try. Thank you. On Sun, May 22, 2016 at 7:54 PM, Otac=C3=ADlio w= rote: > 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. N= ow >> 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 function= s. >> >> 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 sta= rt > 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 follo= w: > > |# 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 freeb= sd > 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 revisio= n > 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 recheck= ed > 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:// BUILD MACHINE>:8080 > > 12. While poudriere compile the ports it is necessary configure beaglebon= e > 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-fo= r-the-beaglebone-black/ > But I have modified some things. |||I hope that this can help you.| []'s > -Otac=C3=ADlio | > > _______________________________________________ > 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" >