Gentoo Archives: gentoo-embedded

From: "Peter S. Mazinger" <ps.m@×××.net>
To: Daniel <dragonheart@×××××××.au>, solar@g.o
Cc: gentoo-embedded@g.o
Subject: [gentoo-embedded] Re: uclibc buildroot/ toolchain
Date: Sun, 14 Dec 2003 14:49:51
Message-Id: Pine.LNX.4.44.0312141806050.8747-102000@lnx.bridge.net
In Reply to: Re: [gentoo-embedded] Re: uclibc buildroot/ toolchain by Daniel
1 On Sun, 14 Dec 2003, Daniel wrote:
2
3 > --[PinePGP]--------------------------------------------------[begin]--
4 >
5 > > Some proposals for uclibc.ebuild 20031206 (reading it only, not tested):
6 > >
7 > > 1. do not activate SYS_SIGLIST (and SYS_ERRLIST), they are obsoleted and
8 > > no SuSv3 requirement, probably will be removed, and they are easy to
9 > > replace (using sed if you like), there are not so many packages until now
10 > > where I needed it to patch.
11 > >
12 > > sys_siglist[sig] = strsignal(sig) /* util-linux */
13 > > sys_errlist[err] = strerror(err) /* iputils, tcp_wrappers */
14 >
15 > The only reason I put these is was because the busybox 0.60.5 used one of
16 > them.
17 >
18 > > 2. use busybox and tinylogin cvs snapshots (or at least 1.0.0-pre4 for
19 > > busybox), the changes from 0.60.5 are massive.
20 >
21 > Sounds good - that will fix #1.
22
23 right, busybox-1.00-pre3/pre4 does not need them.
24
25 >
26 > > 3. I do not understand why WGET has to be set to true, if you have all
27 > > the needed files in sources/dl (DL_DIR), nothing will be downloaded.
28 >
29 > Its basically to remove the dependancy that wget exists. Someone may have
30 > removed this and I did want to put it as a dependancy since it realy didn't
31 > get used. The portage system will downloads the files from the SRC_URI.
32
33 Ok.
34
35 >
36 > > 4. check uclibc.config and -locale, they are not always in sync (as
37 > > of this writing UNIX98PTY_ONLY is different). My build procedure runs make
38 > > defconfig (getting defaults for arch), after that I add echo
39 > > "CONFIG_<option>=y/n" >> .config and rerun make oldconfig (look in
40 > > uclibc.spec). Easier though is to have only the locale config, copy to
41 > > .config ,echo "CONFIG_LOCALE=n" >> .config, make oldconfig to get
42 > > nonlocal.
43 >
44 > This is great. I was looking for the way to remove interactivity ;-).
45
46 Take a look at the attached uClibc.spec (rpm) to see how I proceed.
47 The same procedure works for busybox >= 1.00-pre.
48 Inspire yourself from my spec files at
49 http://dev.gentoo.org/~solar/rpm_specs/
50 not sure of the location (mentioned in some earlier mail from solar).
51 I'll send him also all my specs/patches again, maybe he'll get it now ;-)
52
53 >
54 > > 5. No comment on src_install, do not know gentoo requirements,
55 >
56 > Gentoo creates a image before the install at
57 > ${D} /var/tmp/portage/uclibc-buildroot-0.9.23/image and this is forced to be
58 > empty at the start of src_install. I've sort of got to copy from staging_dir
59 > to ${D} which is a bit of a waste of space and time. More makefile hacking to
60 > fix this.
61 >
62 > > but check
63 > > the files in $ROOT/usr/lib/gcc-lib/*/version/include, I had here a
64 > > "fixed" zutil.h and linux/nls.h, there could be others too (my build
65 > > system was minimal at that moment)
66 >
67 > I've got that as a symlink like:
68 > /usr/lib/gcc-lib/i386-uclibc/0.9.23 -> /usr/i386-uclibc/lib
69
70 I do not know why you need this link.
71
72 It looks like a binutils requirement, I am building binutils with
73 make tooldir=/usr to get read of the /usr/arch-*/ structure. see
74 binutils.spec
75
76 >
77 > The gcc-config (gentoo wrapper gcc/g++ that maps to specific compilers) looked
78 > for something in /usr/lib/... so I just symlinked an that seems to work. I
79 > need to verify this later.
80 >
81 > The linux/nls.h and the zutil.h are the standard kernel headers. I found a
82 > zutil.h in toolchain_build_$(ARCH)/gcc-3.3.2/zlib/zutil.h have you modified
83 > this one?
84 >
85 > > and it looks like all these get higher
86 > > priority as those installed in $ROOT/usr/include subdir (and you'll end up
87 > > building against different version of headers and libs)
88 >
89 > If you're cross compiling isn't this the desired behaviour? Yes I do need to
90 > somehow handle different kernel versions somehow - will think about later.
91 >
92 > I'm not sure totaly what you're refering to here but I will look into it a
93 > bit.
94
95 I'll try to explain it again:
96 gcc puts zlib.h into it's own include directory. Now you take the
97 toolchain and are building zlib (a version that has a different zutil.h).
98 Maybe this will work if the used flags that influence the include dirs (-I
99 -nostdinc or appropiate) won't allow the usage of gcc's zutil.h. After
100 that compile an application using zlib. Which zutil.h will be used if you
101 do not force something special? As I understand it, gcc's includedir has
102 the highest priority (this is my presumption, could be wrong), so you'll
103 end up using different zutil.h and libz.[so,a]
104
105 I do remove all these addon files from gcc's include directory (I do not
106 put them into package) take a look at gcc.spec
107
108 > I'm intested in incorportating your fixed files along the etdyn
109 and > propolice(?) patches ones that Ned is also trying to get off you.
110
111 Attached, these are newer then those sent to the uclibc list, apply these.
112
113 The propolice patch includes the same ssp.c file as gentoo's glibc.
114 The changes to the last version sent to uclibc list (and also to Ned,
115 but as looks like lost) are only of cosmetical. Some parts
116 could get into 0.9.24 (if Erik will accept them, no answer yet). The PaX
117 team considers the ldso.c patch as "not really an option, it's a bug).
118
119 The patch requires echo "CONFIG_PROPOLICE=y" >> .config
120
121 The etdyn/pie patches enforce no text relocation support in uClibc (as it
122 would do the same PaX option), so no library will work, that has TEXTREL
123 in it (and no binary built as ET_DYN/PIE as it behaves like a library). If
124 you look at my uClibc.spec at the end of %install phase, I am doing a
125 TEXTREL check, to be sure that the built libraries will really work
126 (that's why I know that enabling PROFILING adds TEXTREL to libc.so)
127 I haven't really tested it w/ relocation support (only built one "hello
128 world" binary, I am using exclusively the PaX option in my kernels, so
129 probably I wouldn't have a chance to test it on such kernels. You can
130 remove the requirement if you like to, for the hardened project if should
131 be left as it is and force the environment to be fully PIC.
132 Also remove COMPLETELY_PIC from the config file, it's unused, but does not
133 allow to disable the text relocation.
134
135 The patches require echo "CONFIG_PIE_SUPPORT=y" >> .config
136
137 >
138 > > 6. My changes to (non-locale) config are:
139 > > - CONFIG_PROFILING=n (for "use etdyn" it should be a requirement due to
140 > > TEXTREL in libc.so, checked up to cvs)
141 > > - PTHREADS_DEBUG_SUPPORT=n if non-debugging
142 > > - MALLOC_GLIBC_COMPAT=n
143 > > - UNIX98PTY_ONLY=y
144 > > - UCLIBC_HAS_SCANF_GLIBC_GLIBC_A_FLAG=n /* not really implemented */
145 > > - UCLIBC_HAS_TZ_FILE_READ_MANY=n /* we change only once /etc/TZ */
146 >
147 > Ok will incorporate this. A locale config would be the same right? or is there
148 > some other weird dependancy.
149
150 Comment on these:
151 UNIX98PTY_ONLY=y was changed recently to n in buildroot (due to some
152 report of problems with building dropbear, I do not have the problem, it
153 works for me)
154
155 MALLOC_GLIBC_COMPAT (return for malloc differs). This is what I am
156 aware of: freeswan needs patch. I do not know how to test, if other
157 packages are influenced by this behaviour (the freeswan patch was supplied
158 by someone to the freeswan list). Erik Anderssen considers glibc's malloc
159 behaviour a bug (but enables this option in the configuration)
160
161 LOCALE:
162 If you are building in an environment where locales are not supported,
163 then you need to use the pregenerated data, the locale data can't be
164 rebuilt w/o support for setlocale().
165
166 I had also following scenario (I do not know how to simulate this in a
167 glibc env, setlocale() has to be somehow disabled to test):
168 clean uClibc environment (no glibc) built w/o locale, rebuilding uClibc w/
169 locale, if XLOCALE is enabled it will fail, so the only way to get the
170 XLOCALE option is to build already the toolchain with it, afterwards (I
171 mean building for the target) it is too late.
172
173 The referenced spec files are not all the time working for a toolchain (if
174 you see the toolchain option in them, then it has to be set to 1, to get
175 it work) so interpret them carefully (but they work in the clean uclibc
176 env).
177
178 >
179 > > Best regards, Peter
180 >
181 > Thankyou kindly
182 >
183 > --
184 >
185 > Daniel Black
186 > --
187 > Proudly a Gentoo Linux User.
188 > GnuPG/PGP signed and encrypted email preferred
189 > http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x32A64DC8
190 > --[PinePGP]-----------------------------------------------------------
191 > gpg: WARNING: using insecure memory!
192 > gpg: please see http://www.gnupg.org/faq.html for more information
193 > gpg: Signature made Sun 14 Dec 2003 02:44:47 AM CET using DSA key ID 32A64DC8
194 > gpg: Can't check signature: public key not found
195 > PinePGP: Encryption backend encountered error.
196 > --[PinePGP]----------------------------------------------------[end]--
197 >
198
199 --
200 Peter S. Mazinger <ps.m@×××.net> ID: 0xA5F059F2 NIC: IXUYHSKQLI
201 Key fingerprint = 92A4 31E1 56BC 3D5A 2D08 BB6E C389 975E A5F0 59F2
202
203 ____________________________________________________________________
204 Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a FreeStarttol.
205 Probald ki most! http://www.freestart.hu

Attachments

File name MIME type
uClibc.spec.bz2 application/x-bzip2
uc-pie-prop.tar.bz2 application/x-bzip2

Replies

Subject Author
[gentoo-embedded] Re: uclibc buildroot/ toolchain "Peter S. Mazinger" <ps.m@×××.net>