Madhu R
Madhu R

Reputation: 365

as: unrecognized option '--64'

iam not able run this single simple program. i am getting this error . can you anyone please help me to do resolve this. i am using ubuntu 14.4 and gcc 4.8.5..

madhu.r@CPU-245U:~$ gcc p1.c

as: unrecognized option '--64'

Thanks R Madhu

Upvotes: 1

Views: 9385

Answers (4)

Charles Lee
Charles Lee

Reputation: 81

If you have multiple as, you should set the search path order to enable the proper one.

In my case: After install the risc-v tools chains, I meet the same error. I run such command in term:

$whereis as
/usr/bin/as /opt/local/riscv/riscv64-unknown-elf/bin/as

$which as
/opt/local/riscv/riscv64-unknown-elf/bin/as

So, I change the environment variable "PATH", change the search path order. This error disappear.

Upvotes: 1

codeDr
codeDr

Reputation: 1694

I found this issue while building gcc with a newer version of binutils. When building gcc, it finds a different version of bin/as than the newly built bin/as in your target directory. In my case it was using the system bin/as, not a binutils bin/as, and not the newly built target/bin/as.

I fixed this issue by supplying --with-as=${target}/bin/as option to configure when building gcc.

Update: The gcc build failed. I found a comment in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7589 that if you specify --with-as, you need also specify --with-gnu-as --with-ld=... and --with-gnu-ld, as well.

Upvotes: 0

nishad kamdar
nishad kamdar

Reputation: 107

I had a similar problem.

It was because the default alternatives in /etc/alternatives/gcc should have pointed to /usr/bin/gcc-4.8 but it in turn pointed to the arm toolchain.

This command to update the alternatives solved the problem for me:

~# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8

Upvotes: 0

Madhu R
Madhu R

Reputation: 365

Hi checked for the solution in other forums and got solved.

i also faced similar kind of issue. i updated the gcc tool chain to gcc to gcc-6. and reinstalled the arm-gcc- tools.

https://askubuntu.com/questions/781972/how-can-i-update-gcc-5-3-to-6-1

https://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa

also the important thing is that initially In my .bashrc file i had set many PATHS to different versions/copies of arm-gcc-none-eabi... so then i commented them and kept only one default PATH..

thanks for all the above commented ones.everything helped me.

Upvotes: 1

Related Questions