WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: base-dev: Using 2.6.29.6 header files makes life too hard ...  (Read 2398 times)

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
I was puzzled that no 'dvb-apps.tcz' extension had been supplied for the 3.x repository and so I went to have a play with this. After downloading the latest sources and installation of 'compiletc.tcz' I went ahead with a simple V=1 make (to see a little bit better what commands are actually been used) and got stuck at the very first file:
Code: [Select]
cc -c -I../../lib -g -Wall -W -Wshadow -Wpointer-arith -Wstrict-prototypes -fPIC -MMD -o dvbaudio.o dvbaudio.c
In file included from dvbaudio.c:28:
/usr/include/linux/dvb/audio.h:79: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'audio_attributes_t'
make[2]: *** [dvbaudio.o] Error 1

Well, the header file mentioned here belongs to the 'base-dev.tcz' extension, and the line 79 of this file reads something like
   typedef uint16_t audio_attributes_t;
After a fair amount of trial and error I realized that the file in question predates our current kernel release (i.e. 2.6.33.3) and the respective line now reads
   typedef __u16 audio_attributes_t;
(a subtle but significant difference, which can be either found out from the full kernel sources or from the 'linux-headers-KERNEL.tcz' extension). After "fudging" this one file I got a bit further, but was still not able to build all applications for this package as I got stuck with another issue this time involving 'timer_t'.

As I could not know whether this is a "single file issue" or a bit more widespread I did some analysis using the following command sequence:
Code: [Select]
TCLOOP=/tmp/tcloop
BASE=${TCLOOP}/base-dev/usr
KERNEL=$(uname -r)
HEADERS=${TCLOOP}/linux-headers-${KERNEL}/usr/local/src/linux-headers-${KERNEL}

find ${BASE}/include -type f | sed "s#${BASE}/##" | while read FILE ; do
# printf "\rchecking %-70s" "$FILE" > /dev/stderr
# [ -f ${HEADERS}/${FILE} ] && diff -U 0 ${BASE}/${FILE} ${HEADERS}/${FILE}
  [ -f ${HEADERS}/${FILE} ] && ( \
    diff /usr/${FILE} ${HEADERS}/${FILE} > /dev/null \
      && echo "same      $FILE" \
      || echo "different $FILE" \
    )
done
That provides a simplistic comparison of all files from the '/usr/include' directory (of 'base-dev.tcz') and compares them with files (deep down) from 'linux-headers-KERNEL.tcz'. I'm aware that 'base-dev.tcz' contains way more files than just a subset of what looks like to be kernel header files. Anyway, the result is that for files with the same name 121 of them appear to be identical, but 406 are different.

I realized that the files of 'base-dev.tcz' are not straight copies from the kernel sources but using the 2.x linux headers as a comparison it shows that the numbers are 301 identical and 273 different. Furthermore the differences are "smaller" (like some kind of preprocessor execution), plus the file timestamps between 'base-dev.tcz' and the 2.x linux-headers are only a few days apart.

My conclusion is that 'base-dev.tcz' contains quite a few (subtle ?) differences to the 2.6.33.3 sources, which nevertheless can cause nasty issues.

As I'm not aware that the "cooking recipe" for 'base-dev.tcz' is somewhere to be found I tried a "brute force" replacement of all know differences with:
Code: [Select]
find ${BASE}/include -type f | sed "s#${BASE}/##" | while read FILE ; do
  [ -f ${HEADERS}/${FILE} ] && \
    ! diff ${BASE}/${FILE} ${HEADERS}/${FILE} > /dev/null && \
    sudo rm -f /usr/${FILE} && \
    sudo ln -s ${HEADERS}/${FILE} /usr/${FILE}
done
But life is not that simple, as the attempt to compile 'dvb-apps' is now failing in some different ways. On reflection that finding is not really a surprise as the header files were merely straight copies and were not "cooked" with the "secret sauce".
« Last Edit: July 17, 2011, 02:57:10 AM by maro »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: base-dev: Using 2.6.29.6 header files makes life too hard ...
« Reply #1 on: July 17, 2011, 05:07:08 AM »
Both 1.1.1 and -tip compiled fine for me. But my audio.h has __u16 there.

Now that I check it, yeah, my base-dev is from Dec 2010. Seems it was accidentally updated with the 2.x version in the freetype edit. I'll ping Juanito.


edit: Oh, extension submitted, anyway. I have no such hw, so please test.
The only barriers that can stop you are the ones you create yourself.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14790
Re: base-dev: Using 2.6.29.6 header files makes life too hard ...
« Reply #2 on: July 17, 2011, 06:34:12 AM »
base-dev re-posted

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: base-dev: Using 2.6.29.6 header files makes life too hard ...
« Reply #3 on: July 17, 2011, 07:21:34 AM »
The md5 appears to be still that of the broken ver.
The only barriers that can stop you are the ones you create yourself.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14790
Re: base-dev: Using 2.6.29.6 header files makes life too hard ...
« Reply #4 on: July 17, 2011, 08:08:34 AM »
Yeah - I'd managed to upload a file named base-dev.tcz.md6.txt - fixed now..

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: base-dev: Using 2.6.29.6 header files makes life too hard ...
« Reply #5 on: July 18, 2011, 03:39:20 AM »
Thanks for the correction of 'base-dev.tcz'.

I can now also confirm that the problems that caused a bit of pain yesterday and took a fair amount of time to nail down are now gone.

I guess what this hightlights is that if ALL build scripts would be publicly avalable one might have had a chance to figure that one out much more easily and done some testing with a (locally) corrected version.