Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Problem with compiling hello.c

Hi everyone,

I've got a small problem regarding compiling the hello.c like it was said in the wiki (http://www.nioswiki.com/installnios2linux). There was no problem doing the stuff before. I used the prebuild BinaryToolchain although i don't put it in the /opt directory (no permissions). The verifying works also [1].

When i want to compile the hello.c, i get this error [2]. I know that i have no permissions on /opt... the includefiles aren't there anyway. I'm curious why it wont touch the include files on /home/working/nios2/lib/gcc/nios2-linux-uclibc/3.4.6/include

Anyone got an idea? I think it might be linked up with the prefix stuff in the specs but i don't really know exaktly, i searched also for some config files, but none of them had any effects. For help, idea or even solution i would be grateful. :)

[1]


calderch: pwd
/home/working
calderch: nios2-linux-uclibc-gcc -v
Reading specs from /home/working/nios2/bin/../lib/gcc/nios2-linux-uclibc/3.4.6/specs
Configured with: /root/buildroot/toolchain_build_nios2/gcc-3.4.6/configure --prefix=/opt/nios2 --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=nios2-linux-uclibc --enable-languages=c,c++ --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-shared --disable-nls --enable-threads --enable-multilib
Thread model: posix
gcc version 3.4.6
[2]


calderch: nios2-linux-uclibc-gcc hello.c -o hello -elf2flt
cc1: /opt/nios2/lib/gcc/nios2-linux-uclibc/3.4.6/include: Permission denied
cc1: /opt/nios2/nios2-linux-uclibc/sys-include: Permission denied
cc1: /opt/nios2/nios2-linux-uclibc/include: Permission denied

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    from [1]:

    Configured with: /root/buildroot/toolchain_build_nios2/gcc-3.4.6/configure --prefix=/opt/nios2 --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=nios2-linux-uclibc --enable-languages=c,c++ --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-shared --disable-nls --enable-threads --enable-multilib
    Thread model: posix
    

    the prefix seems to offer a clue:

    --prefix=/opt/nios2
    

    maybe the prefix should be in your /home/working/... directory. is the prefix is defined in:

    Reading specs from /home/working/nios2/bin/../lib/gcc/nios2-linux-uclibc/3.4.6/specs
    

    note: i haven't tinkered with this, just took a look at your outputs
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    thx for the reply.

    yeah i already to change some of the data... but the specs, its asm and if there is something to change i even don't know what i should change :)

    specs:

    *asm:
    %{!EB:%{!meb:-EL}} %{EB|meb:-EB}
    *asm_debug:
    *asm_final:
    *asm_options:
    %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
    *invoke_as:
    %{!S:-o %|.s |
     as %(asm_options) %m.s %A }
    *cpp:
    *cpp_options:
    %(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef}
    *cpp_debug_options:
    %{d*}
    *cpp_unique_options:
    %{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}
    *trad_capable_cpp:
    cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
    *cc1:
    %{G*} %{EB:-meb} %{EL:-mel} %{EB:%{EL:%emay not use both -EB and -EL}}
    *cc1_options:
    %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*}
    *cc1plus:
    *link_gcc_c_sequence:
    %G %L %G
    *endfile:
     crtend%O%s crtn%O%s
    *link:
    %{!EB:%{!meb:-EL}} %{EB|meb:-EB}
    *lib:
    --start-group %{msmallc: -lsmallc} %{!msmallc: -lc} -lgcc  %{msys-lib=*: -l%*}  %{!msys-lib=*: -lc}  --end-group  %{msys-lib=: %eYou need a library name for -msys-lib=} 
    *libgcc:
    -lgcc
    *startfile:
    %{msys-crt0=*: %*} %{!msys-crt0=*: crt1%O%s}  %{msys-crt0=: %eYou need a C startup file for -msys-crt0=}  crti%O%s crtbegin%O%s 
    *switches_need_spaces:
    *cross_compile:
    1
    *version:
    3.4.6
    *multilib:
    . !mno-hw-mul !mhw-mulx !mstack-check !mcustom-fpu-cfg=60-1 !mcustom-fpu-cfg=60-2;mno-hw-mul mno-hw-mul !mhw-mulx !mstack-check !mcustom-fpu-cfg=60-1 !mcustom-fpu-cfg=60-2;mhw-mulx !mno-hw-mul mhw-mulx !mstack-check !mcustom-fpu-cfg=60-1 !mcustom-fpu-cfg=60-2;mstack-check !mno-hw-mul !mhw-mulx mstack-check !mcustom-fpu-cfg=60-1 !mcustom-fpu-cfg=60-2;mcustom-fpu-cfg=60-1 !mno-hw-mul !mhw-mulx !mstack-check mcustom-fpu-cfg=60-1 !mcustom-fpu-cfg=60-2;mcustom-fpu-cfg=60-2 !mno-hw-mul !mhw-mulx !mstack-check !mcustom-fpu-cfg=60-1 mcustom-fpu-cfg=60-2;mstack-check/mcustom-fpu-cfg=60-1 !mno-hw-mul !mhw-mulx mstack-check mcustom-fpu-cfg=60-1 !mcustom-fpu-cfg=60-2;mstack-check/mcustom-fpu-cfg=60-2 !mno-hw-mul !mhw-mulx mstack-check !mcustom-fpu-cfg=60-1 mcustom-fpu-cfg=60-2;mhw-mulx/mstack-check !mno-hw-mul mhw-mulx mstack-check !mcustom-fpu-cfg=60-1 !mcustom-fpu-cfg=60-2;mhw-mulx/mcustom-fpu-cfg=60-1 !mno-hw-mul mhw-mulx !mstack-check mcustom-fpu-cfg=60-1 !mcustom-fpu-cfg=60-2;mhw-mulx/mcustom-fpu-cfg=60-2 !mno-hw-mul mhw-mulx !mstack-check !mcustom-fpu-cfg=60-1 mcustom-fpu-cfg=60-2;mhw-mulx/mstack-check/mcustom-fpu-cfg=60-1 !mno-hw-mul mhw-mulx mstack-check mcustom-fpu-cfg=60-1 !mcustom-fpu-cfg=60-2;mhw-mulx/mstack-check/mcustom-fpu-cfg=60-2 !mno-hw-mul mhw-mulx mstack-check !mcustom-fpu-cfg=60-1 mcustom-fpu-cfg=60-2;mno-hw-mul/mstack-check mno-hw-mul !mhw-mulx mstack-check !mcustom-fpu-cfg=60-1 !mcustom-fpu-cfg=60-2;mno-hw-mul/mcustom-fpu-cfg=60-1 mno-hw-mul !mhw-mulx !mstack-check mcustom-fpu-cfg=60-1 !mcustom-fpu-cfg=60-2;mno-hw-mul/mcustom-fpu-cfg=60-2 mno-hw-mul !mhw-mulx !mstack-check !mcustom-fpu-cfg=60-1 mcustom-fpu-cfg=60-2;mno-hw-mul/mstack-check/mcustom-fpu-cfg=60-1 mno-hw-mul !mhw-mulx mstack-check mcustom-fpu-cfg=60-1 !mcustom-fpu-cfg=60-2;mno-hw-mul/mstack-check/mcustom-fpu-cfg=60-2 mno-hw-mul !mhw-mulx mstack-check !mcustom-fpu-cfg=60-1 mcustom-fpu-cfg=60-2;
    *multilib_defaults:
    EL
    *multilib_extra:
    *multilib_matches:
    mno-hw-mul mno-hw-mul;mhw-mulx mhw-mulx;mstack-check mstack-check;mcustom-fpu-cfg=60-1 mcustom-fpu-cfg=60-1;mcustom-fpu-cfg=60-2 mcustom-fpu-cfg=60-2;
    *multilib_exclusions:
    *multilib_options:
    mno-hw-mul mhw-mulx mstack-check mcustom-fpu-cfg=60-1 mcustom-fpu-cfg=60-2
    *linker:
    collect2
    *link_libgcc:
    %D
    *md_exec_prefix:
    *md_startfile_prefix:
    *md_startfile_prefix_1:
    *startfile_prefix_spec:
    *sysroot_suffix_spec:
    *sysroot_hdrs_suffix_spec:
    *link_command:
    %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %{pie:-pie} %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}    %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov}    %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
    
    i found also the

    /home/working/nios2/bin/../lib/gcc/nios2-linux-uclibc/3.4.6/install-tools/mkheaders.conf

    
    SYSTEM_HEADER_DIR="/opt/nios2/lib/gcc/nios2-linux-uclibc/3.4.6/../../../../nios2-linux-uclibc/sys-include"
    OTHER_FIXINCLUDES_DIRS=""
    FIXPROTO_DEFINES=""
    STMP_FIXPROTO=""
    STMP_FIXINC="stmp-fixinc"
    

    but even if i change this, nothing happens *g*