View previous topic :: View next topic |
Author |
Message |
lalebarde Guru
Joined: 03 Sep 2006 Posts: 464 Location: France, Haute-Garonne
|
Posted: Thu Jul 11, 2013 3:40 pm Post subject: crossdev with MinGW : cross emerge claims existing simlinks |
|
|
Hi all,
I need to set up a cross compiler environment with MinGW for building and testing my application. I have followed :
Code: | emerge -av crossdev
# switched /etc/portage/package.* to directories
# added "/usr/local/portage/cross-i686-pc-mingw32" into PORTDIR_OVERLAY
crossdev --ov-output /usr/local/portage -t i686-pc-mingw32
emerge-wrapper --init |
Code: | # ls -l /usr/i686-pc-mingw32/etc/make.profile
lrwxrwxrwx 1 root root 30 11 juil. 12:08 /usr/i686-pc-mingw32/etc/make.profile -> /usr/portage/profiles/embedded |
The cross compiler looks working :
Code: | $ cd test
$ echo 'int main(){return 0;}' > test.c
$ i686-pc-mingw32-gcc -Wall test.c -o test
$ file test
test: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows
$ wine test.exe |
But when I try to cross-emerge, I have the following error : Code: | # i686-pc-mingw32-emerge net-libs/zeromq
!!! /usr/i686-pc-mingw32/etc/make.profile is not a symlink and will probably prevent most merges.
!!! It should point into a profile within /usr/portage/profiles/
!!! (You can safely ignore this message when syncing. It's harmless.)
Calculating dependencies... done!
* ARCH is not set... Are you missing the '/usr/i686-pc-
* mingw32/etc/portage/make.profile' symlink? Is the symlink correct? Is
* your portage tree complete? |
Here is my cross make.conf : Code: | CHOST=i686-pc-mingw32
CBUILD=x86_64-pc-linux-gnu
ARCH=x86
#ARCH=mingw32
HOSTCC=x86_64-pc-linux-gnu-gcc
E_MACHINE=EM_386
ROOT=/usr/${CHOST}/
# SYSROOT : http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml?part=1&chap=3 §3.b, PORTAGE_CONFIGROOT §3.c
SYSROOT=$ROOT
PORTAGE_CONFIGROOT=$ROOT
ACCEPT_KEYWORDS="x86 ~x86"
USE="${ARCH} zlib bindist make-symlinks minimal"
#MARCH_TUNE="-march=armv4t -mtune=arm9tdmi" #arm-softfloat-linux-uclibc
#MARCH_TUNE="-march=armv5t -mtune=xscale" #armv5teb-softfloat-linux-gnueabi
MARCH_TUNE="-march=x86"
CFLAGS="-O2 -pipe ${MARCH_TUNE} -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
FEATURES="-collision-protect sandbox buildpkg noman noinfo nodoc"
# Be sure we dont overwrite pkgs from another repo..
PKGDIR=${ROOT}packages/
PORTAGE_TMPDIR=${ROOT}tmp/
ELIBC="__LIBC__"
PKG_CONFIG_PATH="${ROOT}usr/lib/pkgconfig/"
#PORTDIR_OVERLAY="/usr/portage/local/"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PORTDIR_OVERLAY="/usr/local/portage/cross-i686-pc-mingw32 /usr/local/portage/layman/pro-audio /usr/local/portage/layman/java-overlay /usr/local/portage/layman/science /usr/local/portage/layman/kde-sunset /usr/local/portage/layman/mornifle-gentoo-package /usr/local/portage/layman/dev-zero /usr/local/portage/layman/dilfridge /usr/local/portage/layman/sunrise /usr/local/portage/layman/nx /usr/local/portage/layman/multimedia /usr/local/portage/layman/pythonhead /usr/local/portage/layman/ikelos /usr/local/portage/layman/godin /usr/local/portage/layman/ibormuth /usr/local/portage/layman/gamerlay /usr/local/portage/layman/seden /usr/local/portage/layman/sabayon /usr/local/portage/layman/sage-on-gentoo /usr/local/portage/layman/flora /usr/local/portage /usr/local/portage/mesEbuilds"
MAKEOPTS="-j9 --load-average=8"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ ftp://gentoo.imj.fr/pub/gentoo/ ftp://mirror.ovh.net/gentoo-distfiles/ http://gentoo.modulix.net/gentoo/ http://ftp.club-internet.fr/pub/mirrors/gentoo/ http://mirror.ovh.net/gentoo-distfiles/ http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" |
Any idea please ? |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21607
|
Posted: Thu Jul 11, 2013 9:18 pm Post subject: |
|
|
What is the output of ls -l /usr/i686-pc-mingw32/etc/make.profile? |
|
Back to top |
|
|
lalebarde Guru
Joined: 03 Sep 2006 Posts: 464 Location: France, Haute-Garonne
|
Posted: Fri Jul 12, 2013 7:33 am Post subject: |
|
|
Here it is : Code: | # ls -l /usr/i686-pc-mingw32/etc/make.profile
lrwxrwxrwx 1 root root 30 11 juil. 12:08 /usr/i686-pc-mingw32/etc/make.profile -> /usr/portage/profiles/embedded |
|
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21607
|
Posted: Fri Jul 12, 2013 9:45 pm Post subject: |
|
|
What is the output of ls -l /usr/i686-pc-mingw32/usr/portage? |
|
Back to top |
|
|
lalebarde Guru
Joined: 03 Sep 2006 Posts: 464 Location: France, Haute-Garonne
|
Posted: Mon Jul 15, 2013 10:01 am Post subject: |
|
|
undefined |
|
Back to top |
|
|
lalebarde Guru
Joined: 03 Sep 2006 Posts: 464 Location: France, Haute-Garonne
|
Posted: Tue Jul 16, 2013 2:39 pm Post subject: |
|
|
I have added : Code: | ln -s /usr/portage/profiles/embedded /usr/i686-pc-mingw32/etc/portage/make.profile
mkdir /usr/i686-pc-mingw32/usr/portage
/usr/i686-pc-mingw32/usr/portage/distfiles
i686-pc-mingw32-emerge --sync |
But when I try to emerge something : Code: | # i686-pc-mingw32-emerge app-portage/eix
!!! /usr/i686-pc-mingw32/etc/portage/make.profile is not a symlink and will probably prevent most merges.
!!! It should point into a profile within /usr/portage/profiles/
!!! (You can safely ignore this message when syncing. It's harmless.)
Calculating dependencies... done!
* ARCH is not set... Are you missing the '/usr/i686-pc-
* mingw32/etc/portage/make.profile' symlink? Is the symlink correct? Is
* your portage tree complete? |
I have defined the simlink as requested (cf 1st line). So ? |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21607
|
Posted: Tue Jul 16, 2013 9:59 pm Post subject: |
|
|
It looks like you synced into the wrong directory. However, there was no need for you to sync a second copy of the tree at all. In most cases, you want /usr/sysroot/usr/portage to link to /usr/portage. |
|
Back to top |
|
|
beatfinger n00b
Joined: 07 Nov 2006 Posts: 13
|
Posted: Wed Jul 17, 2013 1:40 pm Post subject: |
|
|
I'm having a similar issue, but with arm. I set up a link from /usr/armv5te-softfloat-linux-gnueabi/usr/portage to /usr/portage, but I'm still getting the ARCH error.
Code: |
jrsmith3@gentoo ~ $ ls -l /usr/armv5te-softfloat-linux-gnueabi/usr/
total 20
drwxr-xr-x 2 root root 4096 Jul 16 02:57 bin
drwxr-xr-x 31 root root 4096 Jul 16 02:57 include
drwxr-xr-x 5 root root 4096 Jul 16 02:57 lib
lrwxrwxrwx 1 root root 12 Jul 16 23:51 portage -> /usr/portage
drwxr-xr-x 2 root root 4096 Jul 16 02:57 sbin
drwxr-xr-x 5 root root 4096 Jul 16 02:57 share
jrsmith3@gentoo ~ $ ls -l /usr/armv5te-softfloat-linux-gnueabi/etc/
total 8
lrwxrwxrwx 1 root root 30 Jul 15 23:08 make.profile -> /usr/portage/profiles/embedded
drwxr-xr-x 2 root root 4096 Jul 16 23:05 portage
-rw-r--r-- 1 root root 1615 Jul 16 02:55 rpc
jrsmith3@gentoo ~ $ sudo armv5te-softfloat-linux-gnueabi-emerge tslib
Password:
* IMPORTANT: 1 news items need reading for repository 'gentoo'.
* Use eselect news to read news items.
Calculating dependencies... done!
* ARCH is not set... Are you missing the '/usr/armv5te-softfloat-linux-
* gnueabi/etc/portage/make.profile' symlink? Is the symlink correct? Is
* your portage tree complete?
|
|
|
Back to top |
|
|
lalebarde Guru
Joined: 03 Sep 2006 Posts: 464 Location: France, Haute-Garonne
|
Posted: Thu Jul 18, 2013 11:05 am Post subject: |
|
|
@Hu : Thanks for the tip. I have deleted /usr/i686-pc-mingw32/usr/portage and made a link instead to /usr/portage.
For the rest, the problem remains the same : Code: | # i686-pc-mingw32-emerge app-portage/eix
!!! /usr/i686-pc-mingw32/etc/portage/make.profile is not a symlink and will probably prevent most merges.
!!! It should point into a profile within /usr/portage/profiles/
!!! (You can safely ignore this message when syncing. It's harmless.)
Calculating dependencies... done!
* ARCH is not set... Are you missing the '/usr/i686-pc-
* mingw32/etc/portage/make.profile' symlink? Is the symlink correct? Is
* your portage tree complete? |
|
|
Back to top |
|
|
univerz n00b
Joined: 02 Nov 2005 Posts: 6 Location: Slovakia
|
Posted: Wed Sep 04, 2013 3:32 pm Post subject: |
|
|
same here. any good news? |
|
Back to top |
|
|
theism n00b
Joined: 12 Sep 2013 Posts: 2 Location: Chernigov
|
Posted: Thu Sep 12, 2013 5:25 pm Post subject: |
|
|
One solution to:
I add to /usr/portage/profiles/embedded/make.defaults:
ARCH="x86"
But I'm not sure, maybe requires: x86-winnt
-------------- On russian ------------------
Одно из решений:
Я добавил в /usr/portage/profiles/embedded/make.defaults:
ARCH="x86"
Но не уверен, возможно корректней указать: x86-winnt
Установка пошла. |
|
Back to top |
|
|
jingwuyan218 n00b
Joined: 27 Jan 2014 Posts: 1
|
Posted: Mon Jan 27, 2014 1:34 pm Post subject: |
|
|
for armv7 :
ln -s /usr/portage/profile/arch/arm/armv7 /usr/arm-cortex-a8*/etc/make.profile .
试试看。like this _________________ 追求完美,必然艰辛 |
|
Back to top |
|
|
zelurker n00b
Joined: 10 Aug 2014 Posts: 23 Location: France
|
Posted: Wed Jan 07, 2015 9:11 am Post subject: mingw32 |
|
|
apparently for mingw32 replacing the make.profile symlink by :
ln -s /usr/portage/profiles/arch/x86 make.profile
in /usr/i686-pc-mingw32/etc/portage
fixed the problem for me...
EDIT : no it didn't, the compilations work, but in the end the link report undefined reference to winmain16, so I guess I broke the libs I rebuilt... !!!
I guess I'll fall back to good old manual compilation without emerge then... ! |
|
Back to top |
|
|
melinux n00b
Joined: 25 May 2006 Posts: 59 Location: Malta
|
Posted: Fri May 22, 2015 8:58 pm Post subject: |
|
|
Solved the same problem by editing
/usr/portage/profiles/embedded/make.defaults
and adding ARCH="x86"
(Crossdev for Mingw32) |
|
Back to top |
|
|
digifuzzy Tux's lil' helper
Joined: 31 Oct 2014 Posts: 79
|
Posted: Wed Jul 08, 2015 9:03 pm Post subject: |
|
|
Modifying the /usr/portage/profiles/embedded/make.defaults file seems the incorrect approach.
I don't know enough about the emerge internals, but has anyone considered having a MinGW make.default?
Is it possible to create a mingw-based profile?
How can one tell crossdev and {x86_64-w64 | i686-pc}-mingw32 to use this profile? |
|
Back to top |
|
|
popham n00b
Joined: 07 Jan 2016 Posts: 2
|
Posted: Thu Jan 07, 2016 7:34 pm Post subject: |
|
|
I bumbled across this thread while I was facing the same problem. Under the portage manpage, I finally noticed
Code: |
make.defaults
...
PROFILE_ONLY_VARIABLES = ARCH
Prevent critical variables from being changed by the user in make.conf or the env.
...
|
So ARCH cannot be set under make.conf by design! Myself, I'm kinda annoyed that this broken thing was autogenerated for me.
The solution is to copy the profile's make.defaults to the profile override directory (typically /etc/portage/profile/, but I'm using crossdev so mine is /usr/armv7a-hardfloat-linux-gnueabihf/etc/portage/profile/). Now edit the overriding make.defaults to set ARCH. |
|
Back to top |
|
|
bazz n00b
Joined: 18 Mar 2016 Posts: 2
|
Posted: Fri Mar 18, 2016 8:33 pm Post subject: |
|
|
popham wrote: | I bumbled across this thread while I was facing the same problem. Under the portage manpage, I finally noticed
Code: |
make.defaults
...
PROFILE_ONLY_VARIABLES = ARCH
Prevent critical variables from being changed by the user in make.conf or the env.
...
|
So ARCH cannot be set under make.conf by design! Myself, I'm kinda annoyed that this broken thing was autogenerated for me.
The solution is to copy the profile's make.defaults to the profile override directory (typically /etc/portage/profile/, but I'm using crossdev so mine is /usr/armv7a-hardfloat-linux-gnueabihf/etc/portage/profile/). Now edit the overriding make.defaults to set ARCH. |
I found a potentially simpler solution, by just removing "ARCH" from PROFILE_ONLY_VARIABLES in the /usr/xxxx/etc/portage/make.profile/make.defaults. I say potentially because I'm not sure if this a good strategy. _________________ Do you feel lucky, punk?
Well do ya? |
|
Back to top |
|
|
|