I state that I am a beginner.I wrote a small program, max.c
int max(int a,int b){
if(a > b) return a;
return b;
}
I compiled with:
gcc -m32 -S max.c
to generate the IA32 assembly program. Then, I created a small main trial to test the operation of the program, main-max.c
#include <stdio.h>
int max(int a,int b);
int main(){
printf("%d\n",max(3,-5));
printf("%d\n",max(3,5));
return 0;
}
I compiled and passing the assembly code of the program previously compiled:
gcc -m32 main-max.c max.s -o max
gives me the following error:
/usr/bin/ld: saltato /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a incompatible durante la ricerca di
/usr/bin/ld: impossibile trovare -lgcc
/usr/bin/ld: saltato /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so incompatible durante la ricerca
/usr/bin/ld: impossibile trovare -lgcc_s
collect2: error: ld returned 1 exit status
you know help me?