On Sun, Jul 3, 2011 at 4:22 PM, Ruben Van Boxem <vanboxem.ru...@gmail.com>wrote:

> 2011/7/3 Bj Raz <whitequill...@gmail.com>:
> > On Sun, Jul 3, 2011 at 6:06 AM, JonY <jo...@users.sourceforge.net>
> wrote:
> >>
> >> On 7/3/2011 12:10, Bj Raz wrote:
> >> > I've been working on cross compiler for building w64 binaries. I just
> >> > wanted to see if I could do it :P
> >> > I'm following the directions from Linux From Scratch (modifying them
> as
> >> > needed).
> >> > So I've built gcc with c++ support and I have the errors:
> >> >
> >>
> >> See mingw-w64-docs for help on building. A lot of LFS doesn't apply to
> >> mingw-w64.
> >>
> >> > /tools/x86_64-w64-mingw32/bin/ld cannot find dllcrt2.o: No such file
> >> > or directory
> >> > /tools/x86_64-w64-mingw32/bin/ld cannot find crtbegin.o: No such file
> >> > or directory
> >> > /tools/x86_64-w64-mingw32/bin/ld cannot find crtend.o: No such file or
> >> > directory
> >> > collect2: ld returned 1 exit status
> >> > make[2]: *** [libgcc_s.dll] Error 1
> >> > make[1]: *** [all-target-libgcc] Error 2
> >> > make: *** [all] Error 2
> >> > can someone please either send me to the right list, or tell me what I
> >> > should do.
> >> >
> >>
> >> You are missing the CRT, see mingw-w64-crt.
> >>
> >> > my configure options are as follows:
> >> >
> >> > libtool --finish /tools/libexec/gcc/x86_64-w64-mingw32/x.x.x/
> >> > AR=x86_64-w64-mingw32-ar RANLIB=x86_64-w64-mingw32-ranlib \
> >> > ../gcc-4.5.1/configure --prefix=/tools \
> >> > --with-local-prefix=/tools --enable-clocale=gnu \
> >> > --enable-shared --enable-threads=posix \
> >> > --enable-__cxa_atexit --enable-languages=c,c++ \
> >> > --disable-libstdcxx-pch --disable-multilib \
> >> > --disable-bootstrap --disable-libgomp \
> >> > --without-ppl --without-cloog --build=x86_64-suse-linux-gnu
> >> > --host=x86_64-suse-linux-gnu --target=x86_64-w64-mingw32
> >> >
> >>
> >> You'd run into problems setting AR and RANLIB like that, let autotools
> >> do its job.
> >
> > As I said, I'm just following directions from LSF (Linux From Scratch)
> >
> http://archive.linuxfromscratch.org/lfs-museum/6.6/LFS-BOOK-6.6-HTML/chapter05/gcc-pass2.html
> > Everything I've done is based on this and another reference. Combined
> with
> > some of my own figuring out how to make it work.
> >>
> >> Posix thread isn't for the faint hearted, you need to bootstrap
> >> winpthread dll with libgcc, but DLLs can't be built without libgcc. I
> >> suggest you remove --enable-threads=posix unless you have some special
> >> needs, let gcc use the more tested win32 threads.
> >
> > I recently found a reference that shows some threads being win32 rather
> then
> > pthreads "--with-libgc-threads=w32" is another option I've seen recently,
> > and I was wondering if there is also "--with-msvc-threads"  I can't seem
> to
> > find that exactly though. No there is no need for pthreads accept for
> just
> > figuring out the right options right now.
> >>
> >> You are also missing essential options like
> >> --enable-fully-dynamic-strings and --enable-sjlj-exceptions, you are
> >> likely to break ABI from the auto builds. Finally, remove
> >> --enable-__cxa_atexit, it will only work for glibc based hosts as far as
> >> I know.
> >
> > I'll try the flags you are suggesting, would you suggest I do anything
> > different for Pass 1 of building binutils, and gcc?
> > I skipped the Linux Headers, and glibc, and just use mingw-64 headers,
> and
> > msvc headers.
> > Also I had to do that before I made gcc pass 1. rather then after.
> otherwise
> > gcc doesn't build right without the mingw headers.
> >
> > Please refer to the LFS book for more reference to what I'm talking
> about.
> > If you want I can send you the entire history of commands I have done (in
> > the order I did them), I write them all down so I can reproduce it if I
> have
> > to.
> > This also includes where I get my sources from.
>
> It would probably be easier for you to use the options that work: you
> can look at my scripts (if you can read basic Bash) here:
> https://github.com/rubenvb/MinGW-w64-build-scripts/tree/master/toolchain
>
> If you select a versioned tag, like 4.6.1-3, it will be guaranteed to
> work (if you have the source directories set up correctly), especially
> if you download a source package, which includes everything you'll
> need:
> https://github.com/rubenvb/MinGW-w64-build-scripts/tree/master/toolchain
>
> Modify the host and target and build values in the build*.sh scripts,
> and run them: the buildcross*.sh build a cross-compiler, the
> buildmingw*.sh build a native compiler. If you're on MSYS, you won't
> need the cross compiler step.
>
No. My host is x86_64-suse-linux-gnu. Cause msys/mingw doesn't have enough
in it to build its self very well.

>
> The options used to build every bit are in the scripts directory,
> mostly in the scripts named after the package, otherwise in the
> common.sh script. Be sure to use the latest tag, because the master
> branch is quite a mess (cough: read work in progress :) ).
>
> Ruben
>
I've included everything I've done up to this point.

>
>
> >
> > Thank you for the input and help thus far.
> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> All of the data generated in your IT infrastructure is seriously
> valuable.
> >> Why? It contains a definitive record of application performance,
> security
> >> threats, fraudulent activity, and more. Splunk takes this data and makes
> >> sense of it. IT sense. And common sense.
> >> http://p.sf.net/sfu/splunk-d2d-c2
> >> _______________________________________________
> >> Mingw-w64-public mailing list
> >> Mingw-w64-public@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> >>
> >
> >
> >
> ------------------------------------------------------------------------------
> > All of the data generated in your IT infrastructure is seriously
> valuable.
> > Why? It contains a definitive record of application performance, security
> > threats, fraudulent activity, and more. Splunk takes this data and makes
> > sense of it. IT sense. And common sense.
> > http://p.sf.net/sfu/splunk-d2d-c2
> > _______________________________________________
> > Mingw-w64-public mailing list
> > Mingw-w64-public@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> >
> >
>
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
cd $SOURCE
cvs -z 9 -d :pserver:anon...@sourceware.org:/cvs/src login
cvs -z 9 -d :pserver:anon...@sourceware.org:/cvs/src co binutils
/mnt/network/source/binutils/configure --build=$MACHTYPE --host=$MACHTYPE 
--target=$LFS_TGT --prefix=/tools --disable-nls \
--disable-werror ac_cv_sizeof_mp_t=8
make
case $(uname -m) in
x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;;/
easc

if [ $UID != 0 ]
then
        sudo make install
fi

wget http://mingw-wine.googlecode.com/files/mingw64api-mingwport-src.7z
/mnt/network/source/mingw64api-mingwport-src/mingw-w64-headers/configure 
--host=$LFS_TGT --prefix=/tools/$LFS_TGT
make
if [ $UID != 0 ] 
then
        sudo make install
fi

cd $SOURCE
svn checkout svn://gcc.gnu.org/svn/gcc/trunk gcc
/mnt/network/source/gcc/configure --build=$MACHTYPE 
--host=$MACHTYPE--target=$LFS_TGT --prefix=/tools --disable-nls \
--disable-shared --disable-multilib --disable-decimal-float --disable-threads 
--disable-libmudflap \
--disable-libssp --disable-libgomp --enable-languages=c --without-ppl 
--without-cloog \
--with-headers=/tools/$LFS_TGT/include ac_cv_sizeof_mp_limb_t=8
make
if [ $UID != 0 ] 
then
        sudo make install
fi

sudo touch /tools/lib/x86_64-w64-mingw32/x.x.x/specs
chown lfs:lfs /tools/lib/x86_64-w64-mingw32/x.x.x/specs
SPECS=`dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/specs
$LFS_TGT-gcc -dumpspecs | sed \
-e 's@/lib\(64\)\?/ld@/tools&@g' \
-e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
echo "New specs file is: $SPECS"
unset SPECS

$SOURCE/mingw64api-mingwport-src/mingw-w64-crt/configure --build=$MACHTYPE 
--host=$LFS_TGT --disable-lib32 --prefix=/tools
make
if [ $UID != 0 ] 
then
        sudo make install
fi

#-----------------------------------

AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib /mnt/network/source/binutils/confiure \
--prefix=/tools --disable-nls --with-lib-path=/tools/lib --target=$LFS_TGT 
--host=$MACHTYPE \
ac_cv_sizeof_mp_limb_t=8
make
if [ $UID != 0 ] 
then
        sudo make install
fi
make -C ld clean
make -C ld LIB_PATH=/usr/lib:/lib
cp -v ld/ld-new /tools/bin

#------------------------------------
get pthreads
wget http://sourceforege.net/projects/mingw-w64/files/External binary packages 
(Win64 hosted)/pthreads/pthreads-20100604.zip
forget about building it, just extract the *nix exeuctables into 
$LFS_TGT/include and $LFS_TGT/lib
unless you are sure you konw how to build pthreads.
#------------------------------------
cd ../build.gcc2
libtool --finish /tools/libexec/gcc/$LFS_TGT/x.x.x/
AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \
../gcc-4.5.1/configure --prefix=/tools \
--with-local-prefix=/tools --enable-clocale=gnu \
--enable-shared --enable-threads=posix \
--enable-__cxa_atexit --enable-languages=c,c++ \
--disable-libstdcxx-pch --disable-multilib \
--disable-bootstrap --disable-libgomp \
--without-ppl --without-cloog --build=$MACHTYPE --host=$MACHTYPE 
--target=$LFS_TGT
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to