• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » Linux » Linux forum » mtd-utils build error on Ubuntu 10.04 host
Share
Linux
  • Forum
Options
  • Subscribe via RSS

Forums

mtd-utils build error on Ubuntu 10.04 host

This question is answered
weidong zhou
Posted by weidong zhou
on Jul 26 2012 04:05 AM
Intellectual590 points

I strictly followed the instructions on this page to build my own host tools for mtd-utils. http://processors.wiki.ti.com/index.php/MTD_Utilities#MTD-Utils_Compilation

But I am getting error when I try to do make on mtd-utils build.

---------------------------------------------------------------------------------------------------------------------

root@NX-W-3:~/mtd/mtd-utils-d37fcc0# WITHOUT_XATTR=1 make
  CHK     include/version.h
  LD      mkfs.jffs2
/usr/bin/ld: cannot find -llzo2
collect2: ld returned 1 exit status
---------------------------------------------------------------------------------------------------------------------

I think linker was failing to find libs for lzo but apparently I already add

LZOLDFLAGS = -I$(PREFIX)/lib

in the Makefile. Could someone give some help with this?

Makefile changes:

---------------------------------------------------------------------------------------------------------------

# -*- sh -*-

VERSION = 1.4.8

PREFIX = /root/mtd/install
ZLIBCPPFLAGS = -I$(PREFIX)/include
LZOCPPFLAGS = -I$(PREFIX)/include
ZLIBLDFLAGS = -I$(PREFIX)/lib
LZOLDFLAGS = -I$(PREFIX)/lib
LDFLAGS += $(ZLIBLDFLAGS) $(LZOLDFLAGS)
CFLAGS ?= -O2 -g $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)

CPPFLAGS += -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)

-----------------------------------------------------------------------------------------------------------

common.mk changes:

-----------------------------------------------------------------------------------------------------------

CC := $(CROSS)gcc
AR := $(CROSS)ar
RANLIB := $(CROSS)ranlib

# Stolen from Linux build system
comma = ,
try-run = $(shell set -e; ($(1)) >/dev/null 2>&1 && echo "$(2)" || echo "$(3)")
cc-option = $(call try-run, $(CC) $(1) -c -xc /dev/null -o /dev/null,$(1),$(2))

CFLAGS ?= -O2 -g
WFLAGS := -Wall \
    $(call cc-option,-Wextra) \
    $(call cc-option,-Wwrite-strings) \
    $(call cc-option,-Wno-sign-compare)
CFLAGS += $(WFLAGS)
SECTION_CFLAGS := $(call cc-option,-ffunction-sections -fdata-sections -Wl$(comma)--gc-sections)
CFLAGS += $(SECTION_CFLAGS)

ifneq ($(WITHOUT_LARGEFILE), 1)
  CPPFLAGS += -D_FILE_OFFSET_BITS=64
endif

DESTDIR?=
#PREFIX=/usr
EXEC_PREFIX=$(PREFIX)
SBINDIR=$(EXEC_PREFIX)/sbin
MANDIR=$(PREFIX)/share/man
INCLUDEDIR=$(PREFIX)/include

--------------------------------------------------------------------------------------------------------------------

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • weidong zhou
    Posted by weidong zhou
    on Jul 26 2012 04:17 AM
    Verified Answer
    Verified by weidong zhou
    Intellectual590 points

    This issue was solved now.

    Silly me for the typos:

               PREFIX = /home/user/mtd/install
    ZLIBCPPFLAGS = -I$(PREFIX)/include
    LZOCPPFLAGS = -I$(PREFIX)/include
    ZLIBLDFLAGS = -L$(PREFIX)/lib
    LZOLDFLAGS = -L$(PREFIX)/lib
    LDFLAGS += $(ZLIBLDFLAGS) $(LZOLDFLAGS)
    CFLAGS ?= -O2 -g $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Yves McDonald
    Posted by Yves McDonald
    on Aug 09 2012 17:09 PM
    Intellectual320 points

    Lucky you ;-), I went through that exercise too because the mtd-utils package for 10.04 is stuck at version 1.3 (can't upgrade it with the package manager) and the latter is missing the -F option. I need that option to build UBIFS file systems with mkfs.ubifs utility.

    I tried to compile mtd-utils under Ubuntu 10.04 but the build process did not go that far for me: the compiler could not find sys/acl.h. That file did not exist at all on my Linux workstation. The closest header file was linux/posix_acl.h but it lead me to many more errors so I gave up building mtd-utils.

    So, as a workaround, I downloaded a Debian package for mtd-utils version 1.5 and installed it on my Linux box. That worked and I was able to build my filesystem, but I have other issues with UBIFS itself.

    I'm curious here: what is the path to sys/acl.h?

    Cheers! 

    ubifs acl.h mtd-utils
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • weidong zhou
    Posted by weidong zhou
    on Aug 10 2012 03:27 AM
    Intellectual590 points

    I did not find sys/acl.h on my host machine either.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use