Cc1 exe error cpu you selected does not support x86 64 instruction set

Joined: 10 Jul 2008Posts: 642Location: Ottawa, Canada
View previous topic :: View next topic  
Author Message
jordanwb
l33t
l33t

Joined: 10 Jul 2008
Posts: 642
Location: Ottawa, Canada

PostPosted: Mon May 10, 2010 1:29 am    Post subject: [Solved]CPU you selected does not support x86-64 Reply with quote

When trying to compile version 2.6.34-rc5 I get this error:

Quote:
cc1: error: CPU you selected does not support x86-64 instruction set

I’m compiling the kernel for a 64 bit Athlon processor on a 64bit Core 2 Quad. I’m running a 64 bit OS and the CFLAG is set to 64 bit.

Here’s my .config file: http://pastebin.org/215486

emerge —info

Code:
Portage 2.1.8.3 (default/linux/amd64/10.0/desktop/gnome, gcc-4.4.3, glibc-2.10.1-r1, 2.6.32-22-generic x86_64)

=================================================================

System uname: Linux-2.6.32-22-generic-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q8300_@_2.50GHz-with-gentoo-2.0.1

Timestamp of tree: Sat, 08 May 2010 19:30:01 +0000

app-shells/bash:     4.0_p37

dev-lang/python:     2.6.4-r1

dev-util/cmake:      2.6.4-r3

sys-apps/baselayout: 2.0.1

sys-apps/openrc:     0.6.0

sys-apps/sandbox:    1.6-r2

sys-devel/autoconf:  2.13, 2.63-r1

sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1

sys-devel/binutils:  2.18-r3

sys-devel/gcc:       4.4.3-r2

sys-devel/gcc-config: 1.4.1

sys-devel/libtool:   2.2.6b

virtual/os-headers:  2.6.30-r1

ACCEPT_KEYWORDS=»amd64″

ACCEPT_LICENSE=»* -@EULA»

CBUILD=»x86_64-pc-linux-gnu»

CFLAGS=»-march=k8 -O2 -pipe»

CHOST=»x86_64-pc-linux-gnu»

CONFIG_PROTECT=»/etc /usr/share/X11/xkb»

CONFIG_PROTECT_MASK=»/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo»

CXXFLAGS=»-march=k8 -O2 -pipe»

DISTDIR=»/usr/portage/distfiles»

FEATURES=»assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch»

GENTOO_MIRRORS=»http://gentoo.mirrors.tera-byte.com/ http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ »

LANG=»en_US.UTF-8″

LDFLAGS=»-Wl,-O1″

MAKEOPTS=»-j6″

PKGDIR=»/usr/portage/packages»

PORTAGE_CONFIGROOT=»/»

PORTAGE_RSYNC_OPTS=»—recursive —links —safe-links —perms —times —compress —force —whole-file —delete —stats —timeout=180 —exclude=/distfiles —exclude=/local —exclude=/packages»

PORTAGE_TMPDIR=»/var/tmp»

PORTDIR=»/usr/portage»

SYNC=»rsync://rsync.gentoo.org/gentoo-portage»

USE=»X a52 aac acl acpi alsa amd64 berkdb branding bzip2 cairo cdr cli consolekit cracklib crypt css cups curl cxx dbus device-mapper dri dts dvd dvdr eds emboss encode evo exif extras firefox flac fortran gdbm gdu gif glib gnome gnome-keyring gpm gstreamer gtk iconv ipv6 jpeg lcms libnotify mad mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib nautilus ncurses nls nptl nptlonly ogg opengl openmp pam pango pcre pdf perl png policykit ppds pppd python qt3support qt4 readline reflection sdl session spell spl sqlite sse sse2 ssl startup-notification svg sysfs tcpd threads tiff truetype unicode usb utils vorbis x264 xcb xml xorg xulrunner xv xvid zlib» ALSA_CARDS=»ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci» ALSA_PCM_PLUGINS=»adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol» APACHE2_MODULES=»actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias» ELIBC=»glibc» INPUT_DEVICES=»evdev» KERNEL=»linux» LCD_DEVICES=»bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text» RUBY_TARGETS=»ruby18″ USERLAND=»GNU» VIDEO_CARDS=»radeon» XTABLES_ADDONS=»quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account»

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

Last edited by jordanwb on Mon May 10, 2010 6:16 pm; edited 1 time in total

Back to top

View user's profile Send private message

Hu
Moderator
Moderator

Joined: 06 Mar 2007
Posts: 19770

PostPosted: Mon May 10, 2010 3:36 am    Post subject: Reply with quote

How did you create this .config? Your immediate problem seems to be CONFIG_MK8=y, but I see lots of other things in here that I find odd.

  • No swap on a laptop.
  • SLUB debugging.
  • MPParse enabled, but SMP disabled.
  • Support for 32 UARTs on a laptop.

Back to top

View user's profile Send private message

jordanwb
l33t
l33t

Joined: 10 Jul 2008
Posts: 642
Location: Ottawa, Canada

PostPosted: Mon May 10, 2010 12:06 pm    Post subject: Reply with quote

Hu wrote:
How did you create this .config?



The same way I’ve made a .config the last 20 times: make menuconfig

Hu wrote:
Your immediate problem seems to be CONFIG_MK8=y



Ok. :?

Hu wrote:
No swap on a laptop.



I’ve never used hibernation

Hu wrote:
SLUB debugging.



I think I understand why I’d want that turned off.

Hu wrote:
MPParse enabled, but SMP disabled.



Processor is single core. I think I have an idea what MPParse is

Hu wrote:
Support for 32 UARTs on a laptop.



Ok. :?

Last edited by jordanwb on Mon May 10, 2010 12:15 pm; edited 1 time in total

Back to top

View user's profile Send private message

DaggyStyle
Watchman
Watchman

Joined: 22 Mar 2006
Posts: 5876

PostPosted: Mon May 10, 2010 12:12 pm    Post subject: Reply with quote

your CXXFLAGS are wrong.

change them to core2 and retry.

not sure it will work thought but worth trying it.
_________________
Only two things are infinite, the universe and human stupidity and I’m not sure about the former — Albert Einstein
Back to top

View user's profile Send private message

jordanwb
l33t
l33t

Joined: 10 Jul 2008
Posts: 642
Location: Ottawa, Canada

PostPosted: Mon May 10, 2010 12:16 pm    Post subject: Reply with quote

But my laptop’s processor is a Athlon64 single core processor.

I found SLUB debugging and disabled it

I think I found the bit about UART’s. My laptop doesn’t have any actual serial ports, however would 4 be safe?

I tried to recompile the kernel and this was the few lines before «CPU you have selected…»

Code:
CC arch/x86/kernel/acpi/boot.o

CC arch/x86/kernel/acpi/sleep.o

LDS arch/x86/kernel/acpi/realmode/wakeup.lds

AS arch/x86/kernel/acpi/realmode/wakeup.o

cc1: error CPU you selected does not support x86-64 instruction set

cc1: error CPU you selected does not support x86-64 instruction set

cc1: warning: -mregparm is ignored in 64-bit mode

make[4]: *** [arch/x86/kernel/acpi/realmode/wakeup.o] Error 1

make[3]: *** [arch/x86/kernel/acpi/realmode/wakeup.bin] Error 2

make[2]: *** [arch/x86/kernel/acpi] Error 2

make[1]: *** [arch/x86/kernel] Error 2

make: *** [arch/x86] Error 2

Back to top

View user's profile Send private message

jordanwb
l33t
l33t

Joined: 10 Jul 2008
Posts: 642
Location: Ottawa, Canada

PostPosted: Mon May 10, 2010 5:04 pm    Post subject: Reply with quote

I tried gentoo-sources-2.6.33-r2 and it fails to build as well. Maybe gcc is hosed. That was one of the packages that I upgraded yesterday.
Back to top

View user's profile Send private message

DaggyStyle
Watchman
Watchman

Joined: 22 Mar 2006
Posts: 5876

PostPosted: Mon May 10, 2010 5:10 pm    Post subject: Reply with quote

whats the output of gcc-config -l?
_________________
Only two things are infinite, the universe and human stupidity and I’m not sure about the former — Albert Einstein
Back to top

View user's profile Send private message

jordanwb
l33t
l33t

Joined: 10 Jul 2008
Posts: 642
Location: Ottawa, Canada

PostPosted: Mon May 10, 2010 5:20 pm    Post subject: Reply with quote

Code:
JORDAN-LAPTOP ~ # gcc-config -l

 [1] x86_64-pc-linux-gnu-4.4.3 *

JORDAN-LAPTOP ~ #

Back to top

View user's profile Send private message

Ant P.
Watchman
Watchman

Joined: 18 Apr 2009
Posts: 6920

PostPosted: Mon May 10, 2010 5:31 pm    Post subject: Reply with quote

You might be better off just using the «Generic x86-64» CPU setting. K8 is the oldest 64-bit x86 anyway so there won’t be much difference.
Back to top

View user's profile Send private message

jordanwb
l33t
l33t

Joined: 10 Jul 2008
Posts: 642
Location: Ottawa, Canada

PostPosted: Mon May 10, 2010 5:35 pm    Post subject: Reply with quote

Tried generic x86-64 and compilation failed too.

On the Gentoo IRC I was directed to this: https://bugs.gentoo.org/309691

Installing gcc 4.3.4 lets me compile the kernel. Let’s see if this fixes my hwclock and sound card issues.

Back to top

View user's profile Send private message

Display posts from previous:   

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Go Back   EQEmulator Home > EQEmulator Forums
> Support

> Support::Linux Servers

Reload this Page

CPU you selected does not support x86-64 instruction set

User Name Remember Me?
Password
Home Forums Register Members List Today’s Posts Search

Support::Linux Servers Support forum for Linux EQEMu users.

Reply
Page 1 of 2 1 2 >
Thread Tools

Display Modes

 
#1  

Old

07-19-2011, 05:16 PM

Harcourt

Sarnak

 

Join Date: Jul 2011

Posts: 33

Default
CPU you selected does not support x86-64 instruction set


I’ve searched for this, but nothing on this site turns up. This error seems common in a number of other projects, but I bet someone here has ran into it.

Yes, I’m trying to build on a 64-bit machine. All of my machines have over 4G, and are running 64-bit OS’s. I’m sure EQEmu will appreciate some extra RAM.

During the build, these errors come out on stderr:

cc1plus: error: CPU you selected does not support x86-64 instruction set

(That message came during a «make clean»).

When I do a regular make I get 97 of these messages before the build
halts during the compile of common/timer.cpp

I have downloaded the source tree from SVN today, so this is on the most recent code base.

Does anyone have a recommendation? I really want to build this from source, as I would like to make some local changes.

Reply With Quote

 
#2  

Old

07-19-2011, 10:33 PM

lerxst2112

Demi-God

 

Join Date: Aug 2010

Posts: 1,745

Default


What is the output from uname -a?

Reply With Quote

 
#3  

Old

07-19-2011, 10:49 PM

Harcourt

Sarnak

 

Join Date: Jul 2011

Posts: 33

Default


Linux xxxxxxxxxxxxxxx 2.6.38.8-35.fc15.x86_64 #1 SMP Wed Jul 6 13:58:54 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

Reply With Quote

 
#4  

Old

07-19-2011, 11:39 PM

lerxst2112

Demi-God

 

Join Date: Aug 2010

Posts: 1,745

Default


Ok. If you google for that error you’ll see it’s generally due to one or more of the packages you have installed. I would go through the prereqs for the server like MySQL, Perl, etc, and make sure they are up to date and installed for the appropriate architecture.

Reply With Quote

 
#5  

Old

07-20-2011, 02:40 PM

Harcourt

Sarnak

 

Join Date: Jul 2011

Posts: 33

Default


I’ve googled the error, and it didn’t seem to me that there was any consensus on what the cause was. I am leaning towards something in a makefile assuming 32-bits, unless people are building this code in a 64-bit environment.

I did check on the installed software, here are the installed packages matching the prereqs in the linux server guides:

Installed Packages
gcc.x86_64 4.6.0-9.fc15 @anaconda-InstallationRepo-201105131943.x86_64
gcc-c++.x86_64 4.6.0-9.fc15 @anaconda-InstallationRepo-201105131943.x86_64
mysql.x86_64 5.5.14-2.fc15 @anaconda-InstallationRepo-201105131943.x86_64
mysql-devel.x86_64 5.5.14-2.fc15 @updates
mysql-server.x86_64 5.5.14-2.fc15 @anaconda-InstallationRepo-201105131943.x86_64
perl.x86_64 4:5.12.4-159.fc15
@anaconda-InstallationRepo-201105131943.x86_64
perl-IO-stringy.noarch
2.110-15.fc15 @fedora

I believe that perl-IO-stringy is noarch since it is not executable code, but rather PERL. The others are the proper 64-bit versions.

Reply With Quote

 
#6  

Old

07-20-2011, 06:28 PM

Harcourt

Sarnak

 

Join Date: Jul 2011

Posts: 33

Default
Think I see the problem


Nothing to do with installed packages.

The default makefiles build with -march=i686 which is causing all of those errors on my 64-bit system.

In several directories I see makefile.a64, so manually issuing a «make -f makefile.a64» gets me further along.

There was one problem in zone where the PERL_FLAGS were not being used, I modified makefile.a64 to work like makefile in that respect.

There were a few directories with no makefile.a64, so I copied makefile to makefile.a64 and switched the architecture.

Everything builds. There are a ton of warnings for various things that shouldn’t hurt (comparison between signed and unsigned).

Of course, since it builds it must run correctly.

I’m interested in hearing comments on the above. If folks are building 64-bit just fine, then I am somehow in the minority and would like to know why. If I am one of a handful doing this, then it would be nice to know who is maintaining the a64 makefiles and discuss changes might make others’ have an easier time.

I would also feel a ton better if those warnings were gone, and may clean up my build tree. If there is interest we can discuss getting those changes back into subversion at some point.

Reply With Quote

 
#7  

Old

07-20-2011, 06:32 PM

lerxst2112

Demi-God

 

Join Date: Aug 2010

Posts: 1,745

Default


Many people are able to compile for 64 bit just fine.

Based on my google search, what you’re looking for is something specifying -march, -mcpu, or -mtune with an inappropriate value for 64-bit support.

Here’s a likely candidate from the makefile in zone. I didn’t check any others.

COPTS=$(WFLAGS) -O -g

-march=i686 -pthread -pipe -D_GNU_SOURCE -DINVERSEXY -DFX -DZONE $(DFLAGS) $(MYSQL_FLAGS) $(PERL_FLAGS)

Reply With Quote

 
#8  

Old

07-20-2011, 06:58 PM

Harcourt

Sarnak

 

Join Date: Jul 2011

Posts: 33

Default


That is pretty much what I just said.

Reply With Quote

 
#9  

Old

07-20-2011, 09:09 PM

lerxst2112

Demi-God

 

Join Date: Aug 2010

Posts: 1,745

Default


Well, I replied before I saw your post. Good luck with your server.

Reply With Quote

 
#10  

Old

08-08-2011, 05:16 PM

mgellan's Avatar

mgellan

Sarnak

 

Join Date: Mar 2007

Location: NA

Posts: 48

Default


I changed the -march=686 to -march=athlon64 (I think, been a while) to ensure everything compiled right. Worked like a charm.

Regards,
Mg

Reply With Quote

 
#11  

Old

11-22-2011, 11:03 AM

LordAdakos

Sarnak

 

Join Date: Dec 2007

Posts: 57

Default


another thing you can do is to just install on an i386 version, and then do a apt-get install linux-image-2.6-686-bigmem (if i recall correctly) to utilize more than 4 gigs of ram.

Reply With Quote

 
#12  

Old

12-17-2011, 11:45 PM

provocating's Avatar

provocating

Demi-God

 

Join Date: Nov 2007

Posts: 2,177

Default


I did get mine to compile, it even ran with no errors. Unfortunately the zones crash as you go in. My database and source are the same as my Debian 32 bit. I ran everything through the command line, and checked the logs and there are no errors, I just get a message that the zone restarted.

There is another message on the forum with other people getting that same «rebooting zone» message that have tried to run x64. Anyone had success ?

Reply With Quote

 
#13  

Old

12-18-2011, 12:20 AM

lerxst2112

Demi-God

 

Join Date: Aug 2010

Posts: 1,745

Default


It would help to see a stack trace of the crash. Load a core file in gdb and type ‘bt’

Reply With Quote

 
#14  

Old

12-18-2011, 12:37 AM

provocating's Avatar

provocating

Demi-God

 

Join Date: Nov 2007

Posts: 2,177

Default


Is there a way to force it to do a core dump ? The zone appears to be rebooting, but there is never a core dump to debug.

Reply With Quote

 
#15  

Old

12-18-2011, 12:56 AM

provocating's Avatar

provocating

Demi-God

 

Join Date: Nov 2007

Posts: 2,177

Default


I ended up removing the -O from the makefiles and all is well.

Just for notation, this is vSphere 5, Debian 6 AMD64 build, with a Xeon 8 core processor.

Reply With Quote

Reply
Page 1 of 2 1 2 >

«
Previous Thread
|
Next Thread
»


Posting Rules

You may not post new threads

You may not post replies

You may not post attachments

You may not edit your posts


BB code is On

Smilies are On

[IMG] code is On

HTML code is Off


Forum Rules

Forum Jump

All times are GMT -4. The time now is 04:45 AM.

EQEmulator —

Archive —

Top

 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.

  • Home
  • Forum
  • The Ubuntu Forum Community
  • Ubuntu Specialised Support
  • Gaming & Leisure
  • glheretic — «cc1: error: CPU you selected does not support x86-64 instruction set»

  1. glheretic — «cc1: error: CPU you selected does not support x86-64 instruction set»

    I’m trying to install Heretic from source.

    I downloaded the .tar.gz shareware wad from here; no problems.

    I began following the instructions on this page, and when I tried entering

    I got this output:

    Code:

    make glheretic - will build GLHeretic - needs OpenGL hardware accelleration
    
     make sndserver - will build the soundserver for Heretic
    
     make musserver - will build the musicserver (from lxdoom) for Heretic
    
     make clean     - will clean up object and exec files

    So then I tried entering , and the terminal gave me this:

    Code:

    gcc -pipe -E -M -Wall -DUNIX -DHAVE_USLEEP -DHAVE_MATH_H -DHAVE_VALUES_H -DLINUX_MOUSE -DUDP_PROTOCOL -DI_GGI_HERETIC -DNEED_SHMGETEVENTBASE -D__NEWVGALIB__  -O2 -fomit-frame-pointer -mcpu=i586 -march=i586 -D__32BIT__ -DHAVE_ALLOCA_H -DINLINE_FIXED -I. -I.. -I/usr/X11R6/include -D__DOSOUND__ -DSNDSERV -Isoundclient -D__DOMUSIC__ -DMUSSERV  -Iopengl -DGL_HERETIC -I/usr/X11R6/include -DNICE_GL -L/usr/X11R6/lib *.c opengl/*.c 
        soundclient/i_sound.c soundclient/soundst.c soundclient/sounds.c m_misc.c graphics/i_sdl_gl.c > .depend 
    gcc: warning: �-mcpu=� is deprecated; use �-mtune=� or �-march=� instead
    cc1: error: CPU you selected does not support x86-64 instruction set
    #snip
    make: *** [depsdlogl] Error 1

    (note: it actually output

    Code:

    cc1: error: CPU you selected does not support x86-64 instruction set

    a little over 100 times, but I’ve cut out all but one to keep this post to a reasonable length. The shows where the rest were).

    I did some Googling, and I think the problem might be to do with gcc, but I can’t find any way to update it.

    Stuff that is probably relevant:

    * I’m using Ubuntu 12.04
    *

    gives

    Code:

    gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

    * gives

    Code:

    Linux <my PC's name> 3.2.0-27-generic #43-Ubuntu SMP Fri Jul 6 14:25:57 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

    Anybody know what might be going on?


  2. Re: glheretic — «cc1: error: CPU you selected does not support x86-64 instruction set

    The package you are trying to build has been configured to target 32 bit systems. We know this because

    Code:

    -mcpu=i586 -march=i586 -D__32BIT__

    are passed to gcc.

    On a 64-bit system such as yours, the gcc and associated libraries are 64-bit and cannot generate code for 32 bit.

    That’s what your error message means. Now what can you do about it? If you are only going to run it on your 64-bit system, then find out whether you can configure it for a 64-bit build. If you want to run it on 32-bit systems or if this software only works as 32-bit, then you will need to install extra gcc and library packages for building 32-bit on 64-bit systems. (I don’t recall the package names.)


Bookmarks

Bookmarks


Posting Permissions

I have the following CPU config;
lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 6
.
.
.

But when I try to make cnn, i get an error message saying CPU you selected does not support x86-64 instruction set.

Here is the complete error log:
make VERBOSE=1
/usr/local/bin/cmake -H/home/riyaz/GIT_Projects/cNN/cnn -B/home/riyaz/GIT_Projects/cNN/cnn/build —check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/bin/cmake -E cmake_progress_start /home/riyaz/GIT_Projects/cNN/cnn/build/CMakeFiles /home/riyaz/GIT_Projects/cNN/cnn/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory /home/riyaz/GIT_Projects/cNN/cnn/build' make -f cnn/CMakeFiles/cnn.dir/build.make cnn/CMakeFiles/cnn.dir/depend make[2]: Entering directory/home/riyaz/GIT_Projects/cNN/cnn/build’
cd /home/riyaz/GIT_Projects/cNN/cnn/build && /usr/local/bin/cmake -E cmake_depends «Unix Makefiles» /home/riyaz/GIT_Projects/cNN/cnn /home/riyaz/GIT_Projects/cNN/cnn/cnn /home/riyaz/GIT_Projects/cNN/cnn/build /home/riyaz/GIT_Projects/cNN/cnn/build/cnn /home/riyaz/GIT_Projects/cNN/cnn/build/cnn/CMakeFiles/cnn.dir/DependInfo.cmake —color=
make[2]: Leaving directory /home/riyaz/GIT_Projects/cNN/cnn/build' make -f cnn/CMakeFiles/cnn.dir/build.make cnn/CMakeFiles/cnn.dir/build make[2]: Entering directory/home/riyaz/GIT_Projects/cNN/cnn/build’
/usr/local/bin/cmake -E cmake_progress_report /home/riyaz/GIT_Projects/cNN/cnn/build/CMakeFiles 1
[ 3%] Building CXX object cnn/CMakeFiles/cnn.dir/cfsm-builder.cc.o
cd /home/riyaz/GIT_Projects/cNN/cnn/build/cnn && /usr/bin/c++ -fPIC -funroll-loops -Wall -std=c++11 -Ofast -g -DEIGEN_FAST_MATH -march=native -I/home/riyaz/GIT_Projects/cNN/cnn -I/home/riyaz/GIT_Projects/cNN/cnn/external/easyloggingpp/src -I/usr/local/include -I/home/riyaz/GIT_Projects/cNN/cnn/../eigen -I/home/riyaz/GIT_Projects/cNN/cnn/build -o CMakeFiles/cnn.dir/cfsm-builder.cc.o -c /home/riyaz/GIT_Projects/cNN/cnn/cnn/cfsm-builder.cc
/home/riyaz/GIT_Projects/cNN/cnn/cnn/cfsm-builder.cc:1:0: error: CPU you selected does not support x86-64 instruction set
make[2]: *** [cnn/CMakeFiles/cnn.dir/cfsm-builder.cc.o] Error 1
make[2]: Leaving directory /home/riyaz/GIT_Projects/cNN/cnn/build' make[1]: *** [cnn/CMakeFiles/cnn.dir/all] Error 2 make[1]: Leaving directory/home/riyaz/GIT_Projects/cNN/cnn/build’
make: *** [all] Error 2

Я хочу скомпилировать программу, в которой есть много 32-битных статических библиотек, которые я не могу перекомпилировать в 64-битные из-за отсутствия make-файлов, но есть некоторые библиотеки, которые я должен скомпилировать, чтобы получить некоторые статические библиотеки для использования вместе с ними.

Одна из библиотек, которую я хочу скомпилировать, имеет Makefile следующим образом:

CC = c++

BIN_DIR = ../lib

BIN = $(BIN_DIR)/libsql.a

CFLAGS = -w -O3 -ggdb3 -g3 -std=c++14 -pipe -mtune=i386 -fstack-protector -static

CPP=AsyncSQL.cpp Semaphore.cpp Statement.cpp Tellwait.cpp

all: $(BIN)

clean:
    @echo Delete .obj files
    @rm -f *.o

%.o: %.cpp
    @echo -e "33[0;32m [OK] 33[0m" $<
    @$(CXX) $(CFLAGS) -c $^ -o $@

$(BIN): $(CPP:%.cpp=%.o)
    @ar cru $(BIN) $^
    @ranlib $(BIN)
    @rm -rf *.o

В результате получается следующий результат:

 cc1plus: error: CPU you selected does not support x86-64 instruction set

Если я опущу параметр -mtune=i386, он будет успешно скомпилирован, но тогда я должен скомпилировать остальные библиотеки как 64-битные двоичные файлы, и в конце я не смогу скомпилировать эти статические 32-битные.

Как я могу устранить эту ошибку?

Любое предложение будет оценено.

1 ответ

Лучший ответ

Чтобы скомпилировать 32-битный код в 64-битной системе, используйте параметр -m32 для gcc. -mtune=i386 неверно.


2

Nate Eldredge
25 Май 2020 в 22:12

I’m trying to use

pip install mysql-python

inside a virtualenv container and am getting the error

building '_mysql' extension

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,4,'final',1) -D__version__=1.2.4 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1

_mysql.c:1:0: error: CPU you selected does not support x86-64 instruction set

error: command 'gcc' failed with exit status 1

Why is gcc trying to use -march=i686 when I’m on a 64-bit system and using a 64-bit version of Python?

Gilles 'SO- stop being evil''s user avatar

asked Jul 7, 2013 at 12:59

Matt Healy's user avatar

0

You can set your architecture manually by setting the CFLAGS environmental variable.

CFLAGS='-march=x86-64' pip install mysql-python

This variable’s contents are appended to gcc‘s argument list.

answered Jul 8, 2013 at 0:19

2

Я пытаюсь следовать учебник в этой ссылка.

когда я подошел к той части, где я начинаю делать тест.файл c, я пытаюсь запустить первую строку компиляции.

gcc -c -g -Os -march=i686 -ffreestanding -Wall -Werror test.c -o test.o

вот содержание test.c

__asm__(".code16n");
__asm__("jmpl x0000, $mainn");

void main() {
}

когда я вызываю первую строку компиляции, она показывает мне эту ошибку.

test.c:1:0: error: CPU you selected does not support x86-64 instruction set
 __asm__(".code16n");
 ^

может кто-нибудь сказать мне, почему это происходит? И если возможно, как это исправить?

Я запускаю Ubuntu Desktop x64, заранее спасибо за вашу помощь.

EDIT:

Я изменил первую строку компиляции:

gcc -c -g -Os -m32 -ffreestanding -Wall -Werror test.c -o test.o

и, кажется, работает нормально. Однако есть еще две строчки, которые меня беспокоят.

ld -static -Ttest.ld -nostdlib --nmagic -o test.elf test.o

и

objcopy -O binary test.elf test.bin

первый бросает мне ошибку.

ld: i386 architecture of input file `test.o' is incompatible with i386:x86-64 output

и из-за этого, я не пробовал последнюю строку компиляции.

вот код для тест.файл ЛД.

ENTRY(main);
SECTIONS
{
    . = 0x7C00;
    .text : AT(0x7C00)
    {
        *(.text);
    }
    .sig : AT(0x7DFE)
    {
        SHORT(0xaa55);
    }
} 

любые предложения о том, как это исправить?

3 ответов


источник -m32 вместо -march=i686.


в самом деле добавить -m32 вы можете сохранить-март=i686 …

gcc -c -g -Os -march=i686 -m32 -ffreestanding -Wall -Werror test.c -o test.o

работает

gcc -c -g -Os -march=i686 -m16 -ffreestanding -Wall -Werror test.c -o test.o

работает

gcc -c -g -Os -march=i686 -m64 -ffreestanding -Wall -Werror test.c -o test.o

завершается с ;


gcc -std=c99 -c -g -Os -march=i686 -m32 -ffreestanding -Wall -Werror test.c -o test.o
ld -static -T test.ld -m elf_i386 -nostdlib --nmagic -o test.elf test.o

Понравилась статья? Поделить с друзьями:
  • Cc1 error unrecognized
  • Cc1 error no include path in which to search for stdc predef h
  • Cc1 error code model kernel does not support pic model
  • Cd16 ошибка мта как исправить
  • Cc1 error code model kernel does not support pic mode