Tiny Core Linux

Tiny Core Base => TCB Bugs => Topic started by: lkraemer on December 17, 2011, 05:27:37 PM

Title: TC 4.1 - GCC Compile of com.c - BUGS
Post by: lkraemer on December 17, 2011, 05:27:37 PM
Robert,
I have used TC 4.0.1 to compile com.c a program I am developing.  Today I installed TC 4.1 on
my Ampro ReadyBoard.  I wanted to compile and test my com.c program.

I first wanted to do an 'updatedb" so locate & find would find the header files I wanted to locate.

Code: [Select]
#include <termios.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/signal.h>
#include <sys/types.h>
#include <string.h>
#include <stropts.h>

I tried "sudo updatedb".  I got an error that the subdirectory var was missing. So, I created
/usr/local/var  and now updatedb worked.  Shouldn't var have existed in the TC 4.1 system?

Next a test compile of com.c was tried with "gcc -g com.c -o com".  That immediately
generated an error because termios.h couldn't be located.  I went to my old laptop running
4.0.1 and there are several symbolic links to termios.h.  Here are the listings.
Code: [Select]
tc@box:~$ sudo updatedb
tc@box:~$ locate termios.h
/usr/include/asm-generic/termios.h
/usr/include/asm/termios.h
/usr/include/bits/termios.h
/usr/include/linux/termios.h
/usr/include/sys/termios.h
/usr/include/termios.h
tc@box:~$

Now, most are symbolic links to the real terminos.h.
Code: [Select]
tc@box:~/documents$ locate stdio.h
/usr/include/bits/stdio.h
/usr/include/stdio.h
/usr/local/include/c++/4.6.1/tr1/stdio.h
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/include/ssp/stdio.h
/usr/local/lib/perl5/5.14.1/i686-linux/CORE/nostdio.h
/usr/local/share/syslinux/com32/include/stdio.h
tc@box:~/documents$ locate stdio.h
/usr/include/bits/stdio.h
/usr/include/stdio.h
/usr/local/include/c++/4.6.1/tr1/stdio.h
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/include/ssp/stdio.h
/usr/local/lib/perl5/5.14.1/i686-linux/CORE/nostdio.h
/usr/local/share/syslinux/com32/include/stdio.h
tc@box:~/documents$

As an example stdio.h has a symbolic link to stdio.h in version 4.0.1 as shown below:
Code: [Select]
lrwxrwxrwx    1 root     root            48 Jan  4 00:36 stdint.h -> /tmp/tcloop                           /eglibc_base-dev/usr/include/stdint.h
lrwxrwxrwx    1 root     root            47 Jan  4 00:36 stdio.h -> /tmp/tcloop/                           eglibc_base-dev/usr/include/stdio.h
lrwxrwxrwx    1 root     root            51 Jan  4 00:36 stdio_ext.h -> /tmp/tcl                           oop/eglibc_base-dev/usr/include/stdio_ext.h
lrwxrwxrwx    1 root     root            48 Jan  4 00:36 stdlib.h -> /tmp/tcloop                           /eglibc_base-dev/usr/include/stdlib.h
lrwxrwxrwx    1 root     root            48 Jan  4 00:36 string.h -> /tmp/tcloop                           /eglibc_base-dev/usr/include/string.h
lrwxrwxrwx    1 root     root            49 Jan  4 00:36 strings.h -> /tmp/tcloo                           p/eglibc_base-dev/usr/include/strings.h
lrwxrwxrwx    1 root     root            49 Jan  4 00:36 stropts.h -> /tmp/tcloo                           p/eglibc_base-dev/usr/include/stropts.h

But, when I go to TC 4.1 and look for the same symbolic links they are all missing, and this is the
reason I can't get gcc to compile the small com.c program.

Could I have missed installing something that would have generated the symbolic links?  I've
tried to duplicate the same install method I used on 4.0.1 again on 4.1, but I can't be 100% sure
I've not missed something important. 

What am I missing, or have I uncovered a BUG?

THANKS.

Larry




Title: Re: TC 4.1 - GCC Compile of com.c - BUGS
Post by: Rich on December 17, 2011, 08:59:26 PM
Hi lkraemer
I just did a 4.1 install on one of my machines and those headers are indeed there. I installed the
compiler using the recommended method, and that is to install the  compiletc.tcz  extension which
automatically includes GCC, headers, and other tools to compile programs. It sounds like you tried
to pick the extensions required to compile by hand, generally a bad idea.
Quote
I first wanted to do an 'updatedb" so locate & find would find the header files I wanted to locate.
The find utility does not rely on a database, it searches the path you give it.

Title: Re: TC 4.1 - GCC Compile of com.c - BUGS
Post by: lkraemer on December 17, 2011, 09:03:26 PM
Rich,
Thanks, I'll give that a try first thing tomorrow.  I guess I missed that compiletc.tcz file.

Larry
Title: Re: TC 4.1 - GCC Compile of com.c - BUGS
Post by: roberts on December 17, 2011, 10:01:06 PM
compile.tcz is the main compiler meta extension. Always start with that. Then load any "dev" extensions that might be required, e.g. window manager development usually requires Xorg-7.6-dev.tcz.
Title: Re: TC 4.1 - GCC Compile of com.c - BUGS
Post by: curaga on December 18, 2011, 05:45:50 AM
You did find a bug, in findutils - it should have created /usr/local/var in its install script, or (preferably) configured to use the system /var dir at build time.
Title: Re: TC 4.1 - GCC Compile of com.c - BUGS
Post by: Juanito on December 18, 2011, 06:47:29 AM
I think the problem is that /var/lib/locate is not created - added a start-up script to do so and re-posted
Title: Re: TC 4.1 - GCC Compile of com.c - BUGS
Post by: lkraemer on December 21, 2011, 02:15:32 PM

Thanks, compiletc.tcz fixed the compile problem.

Larry