element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Using Xilinx Tools Forum Cross Compiling
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 7 replies
  • Subscribers 343 subscribers
  • Views 1707 views
  • Users 0 members are here
Related

Cross Compiling

Former Member
Former Member over 12 years ago

I'm trying to compile the kernel, but I'm having trouble.

Using the CD that came with the ZedBoard, I installed the Xilinx design tools in Ubuntu 12.04. After that, I ran "$ export CROSS_COMPILE=arm-xilinx-linux-gnueabi-" and "$ source /opt/Xilinx/14.2/ISE_DS/settings32.sh".
Then I downloaded the kernel from github and configured it with "$ make ARCH=arm xilinx_zynq_deconfig".

However, when I run "$ make -j ARCH=arm UIMAGE_LOADADDR=0x8000 uImage", I immediately get errors which report that arm-xilinx-linux-gnueabi-gcc is not found.

I'm not sure where to go from here.

Thanks for the help.

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 12 years ago

    When I set CROSS_COMPILE to "arm-linux-gnueabi-" (which libraries I DO have in my /usr/bin directory), it compiles decently until it gets to "CC fs/jbd/journal.o" and completely freezes my virtual machine.

    A coworker got it compiling fine, but with an older version of the kernel. I'd like to just be able to follow the steps and do this nice and easy but it's proving to be very frustrating.

    Any help would still be appreciated.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jamestkennedy
    0 jamestkennedy over 12 years ago in reply to Former Member

    sorry for your trouble. if you follow the speedway instructions verbatim i think you avoid problems.
    in the past i have deviated and run into similar problems accessing the tools.
    perhaps the scope of your CROSS_COMPILE variable is getting lost in the invocations of the build shell.
    have you tried putting the export into your /etc/profile file or bashrc file to make sure it is global in scope?
    sorry for your trouble.
    if you have time start from a new machine and follow the speedway verbatim.
    linux is very flexible and non-generic if you want it your way, but sometimes you subtly break the intent of xilinx provided facilities?
    good luck with this -- you have my sympathies.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to jamestkennedy

    Thank you for the reply.

    With the CROSS_COMPILE variable I tried a few things. I originally did what the walk through (at http://www.wiki.xilinx.com/Install+Xilinx+Tools) said and exported my CROSS_COMPILE variable. It could not find "arm-xilinx-linux-gnueabi-". So I used the CD that came with the ZedBoard to install the "Xilinx Design Tools". This includes Vivado Design Suite which is the ISE, XPS, SDK, and 10 other acronyms... After 2 hours of installing and configuring... still no "Xilinx cross-compile toolchain" as desired. I ended up using the gcc-arm-linux-gnueabi cross compiler (using $sudo apt-get install gcc-arm-linux-gnueabi), which worked fine with the u-boot but froze my machine when I used it to compile the kernel. The download page on the wiki directs you to http://www.xilinx.com/support/download/index.htm, which has about everything except for the xilinx/arm cross-compiler. I don't know how many hours I spend downloading everything on that page looking for cross-compile tools... I finally tried the PetaLinux (which was not mentioned anywhere in the wiki) and while digging around in it, I found the toolchain. Then I read your post james t kennedy, and found the speedway tutorial that had a link to the Sourcery CodeBench cross compile tools right on it. Wow... it was there the whole time (and the link is http://www.xilinx.com/member/mentor_codebench/xilinx-2011.09-50-arm-xilinx-linux-gnueabi.bin for anyone else who is as confused as I am)!

    As for the scope of CROSS_COMPILE, instead of relying on the shell, I added to the make command to ensure it saw it:
    $ make -j V=1 ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- UNIMAGE_LOADADDR=0x8000 uImage
    (where V=1 makes it more verbose so I could see what's happening). I just had to make sure that the directory that contained the arm-xilinx-linux-gnueabi- commands was included in my $PATH.

    Now, when I try to compile the kernel, I get a lot of strange errors. I'll copy a portion of them below:

    .
    .
    .
      CC      mm/page_alloc.o
      CC      kernel/capability.o
      CC      fs/open.o
      CC      kernel/sysctl_binary.o
    .
    .
    <other normal compilation messages>
    .
    .
    arch/arm/kernel/return_address.c:62:2: warning: #warning "TODO: return_address should use unwind tables" [-Wcpp]
    .
    .
    <more normal stuff>
    .
    .
      CC      fs/proc/mmu.o
    make[2]: vfork: Resource make[2]: vfork: Resource temporarily unavailable
    /bin/sh: fork: retry: Resource temporarily unavailable
    /bin/sh: fork: retry: Resource temporarily unavailable
    .
    .
    <it says this 120 more times (I counted)>
    .
    .
    /bin/sh: fork: retry: Resource temporarily unavailable
    make[1]: *** [kernel/power] Error 2
    make[1]: *** Waiting for unfinished jobs....
    /bin/sh: fork: retry: Resource temporarily unavailable
    .
    .
    <120 more times it says this...>
    .
    .
    arm-xilinx-linux-gnueabi-gcc: error: vfork: Resource temporarily unavailable
    make[2]: fork: retry: Resource temporarily unavailable
    make[2]: *** [fs/exofs/built-in.o] Error 254
    *** [fs/nfs_common/built-in.o] Error 254
    *** [security/commoncap.o] Error 254
    *** [fs/notify/dnotify/built-in.o] Error 254
    *** [fs/sysfs/dir.o] Error 254
    .
    .
    <and other 254 errors>
    .
    .


    I did some looking around and found that the "-j" flag on the makefile will run multiple "jobs" or threads (I'm guessing) at one time (found this from the man page at $ man make). I found out from another site (http://stackoverflow.com/questions/12079087/fork-retry-resource-temporarily-unavailable) that the "fork: retry: Resource temporarily unavailable" message is displayed when there are too many threads running or when there are no more available file descriptors. These limits can be changed, but rather than doing that, the kernel compiles fine without the "-j" flag, it's just slower because it's only doing 1 thing at a time. Perhaps you could put a limit on the number of threads (with a $ make -j 50 ...etc... or something) but whatever. I've finally gotten it to work (sort of) after a week of trying!

    Now, It errors out with this:

    .
    .
    .
      OBJCOPY arch/arm/boot/zImage
      Kernel: arch/arm/boot/zImage is ready
      UIMAGE  arch/arm/boot/uImage
    "mkimage" command not found - U-Boot images will not be built
    make[1]: *** [arch/arm/boot/uImage] Error 1
    make: *** [uImage] Error 2

    But I think I know how to fix this. I'll post again when I've figured it out.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jamestkennedy
    0 jamestkennedy over 12 years ago

    I think the fact remains that something is amiss or awry in your VM setup up to the build environment. I would say sompare what you have done to create it to:
    The Speedway course on this website

    Implementing Linux on the
    Zynqu2122 Zynqu2122 Zynqu2122 -7000 7000 SoC
    Lab 0.1 u2013 Pre-Lab
    Creating a Cross Build Platform for Zynq

    You should not have to "reinvent the wheel" to accomplish this cross build. In the end even with success, you are left with something not in the Avnet/Xilinx beaten path.

    When you install the Codesourcery tools, let that installation set your $PATH. And follow the other instructions of the lab to set up your .bash_profile for the build.

    BTW, the Xilinx Design Tools (ISE) are another story. I do that on my Windows 7 box or on a Linux installation non-VMWARE. Always ask for the codesourcery tools to be installed, but that is separate from this Linux build path. I think it is easier to reconcile the EDK tools that this build, but as I said, I do that under Windows not Linux, so for me, the Linux build is separate and in the VM.

    This processs, the Linux build, was starightforward and did I did not encounte any of the problems of your unorthodox installation.

    Good luck resolving them, but think about a correction a little further back (Speedway course), which leaves you in better stead.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago

    The problem was that the directory that contained mkimage (from building u-boot) was not added properly. My mistake.

    That's what solved my problem - going back and following the speedway course more closely. I'm behind a corporate firewall and CentOS was being annoying so I used Ubuntu instead (the first time) - apparently there are some subtle issues I couldn't figure out. This time around, I trudged through CentOS and got everything working. The only thing that didn't work for me was installing gtk-nodoka-engine.i686, but that didn't seem to affect anything.

    What is the difference between uImage and zImage? They're both in the arch/arm/boot/ directory.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jamestkennedy
    0 jamestkennedy over 12 years ago in reply to Former Member

    http://chaitutechbits.blogspot.com/2010/12/what-is-difference-between-zimage-bz.html

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago

    I too had to face many kind of problem when I compiled the kernel sites and when I have contacted the drupal experts only I found an accurate solution and I would like to advise you to contact a professional drupal developer
    smartparentingadvice.com

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube