LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-13-2010, 05:15 PM   #1
frozenQueue
LQ Newbie
 
Registered: Jul 2010
Posts: 25

Rep: Reputation: 0
building coreutils... functions already defined


I'm building the GNU Coreutils with gcc. However, each attempt to build fails with gcc complaining that the code redefines a function that has already been defined.

Code:
tee.c:35: error: conflicting types for ‘tee’
/usr/include/bits/fcntl.h:254: note: previous declaration of ‘tee’ was here
I "fixed" that by changing the name of "tee" in the Coreutils source code. But then another error came up for another function:

Code:
test.c:142: error: static declaration of ‘eaccess’ follows non-static declaration
/usr/include/unistd.h:297: note: previous declaration of ‘eaccess’ was here
Why is the Coreutils code including these headers if it wants to redefine the functions? Should I be passing in some compiler switch that allows the latest definition to be used?
 
Old 09-13-2010, 07:42 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,006

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Might help if you told us which version of coreutils and what steps you have followed up until the errors you have received?
 
Old 09-14-2010, 11:24 AM   #3
frozenQueue
LQ Newbie
 
Registered: Jul 2010
Posts: 25

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by grail View Post
Might help if you told us which version of coreutils and what steps you have followed up until the errors you have received?
version 5.0

1. Downloaded coreutils from gnu.org.
2. "./configure --prefix=/vm/drv85M-0000-p1 --datadir=/vm/drv85M-0000-p1/usr/include --infodir=/vm/drv85M-0000-p1/usr/share/info --mandir=/vm/drv85M-0000-p1/usr/share/man"
3. "make"

I'm trying to see if I can assemble a tiny Linux system in a very small vm image by building the components externally.
 
Old 09-14-2010, 11:43 AM   #4
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by frozenQueue View Post
...
I'm trying to see if I can assemble a tiny Linux system in a very small vm image by building the components externally.
http://uclinux.org/
 
Old 09-14-2010, 07:11 PM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,006

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Quote:
version 5.0
Well my initial thoughts when seeing such an old version (ie latest is 8.5) that maybe the changes since that version to the location
of headers and information stored in them may have changed quite a bit (i could of course be way off)

Have you perhaps tried the same but with a newer version?
I personally have only compiled this using the instructions from LFS so maybe they can help you.
 
Old 09-15-2010, 01:30 AM   #6
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
http://www.tinycorelinux.com/ -> 'busybox'.
 
Old 09-15-2010, 02:32 AM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
You'll need to match your coreutils version with your glibc/libc version. If you are using glibc>=2.4 you'll need to use a much more modern coreutils. If glibc>=2.9 use the *latest* coreutils.
 
Old 09-16-2010, 11:25 AM   #8
frozenQueue
LQ Newbie
 
Registered: Jul 2010
Posts: 25

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by gnashley View Post
You'll need to match your coreutils version with your glibc/libc version. If you are using glibc>=2.4 you'll need to use a much more modern coreutils. If glibc>=2.9 use the *latest* coreutils.
The old version was definitely the problem. I grabbed 5.0 thinking it was the latest version, but when I looked again, I saw it wasn't. Version 8.5 builds without issues.
 
Old 09-16-2010, 09:24 PM   #9
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,006

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Good news Please mark as SOLVED.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use functions defined inside the kernel source rico1505 Linux - Kernel 2 02-10-2010 01:20 PM
Way to convert Macro Defined functions from linux Kernel in Visual C++ Kunsheng Programming 5 06-29-2009 09:25 AM
Building conexant pci adsl drivers on 2.6.18 kernel with 'CONFIG_REGPARM' defined RichardUK Linux - Networking 0 04-25-2009 03:31 AM
errors building kernel 2.6.29-1 in slackware-current about not defined BITS_PER_LONG leptom Slackware 6 04-11-2009 07:32 PM
FYI: Creating User Defined Functions for MySQL mchirico LinuxQuestions.org Member Success Stories 1 06-11-2004 08:51 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration