Welcome, Guest. Please login or register.

Author Topic: compiling assembly.s files in gcc ... was: gcc wont compile with // comments?  (Read 13536 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
is that right?

it's c code (adoom)

it says "parse error before /" on line 1 of every file.

yes i know // is c++ but it's also c99

gcc 270 is 8 years old or something so is pre 99?


bloody hell all i want to do is compile something and i have to say that gnu lacks so much in terms of FAQs and actual usefull online docs that dont require a lifetime of not having a girlfriend and instead shagging a unix box until you only see the world around you in terms of matrix code.


if you montior these forums you'll know i have a stab at using gcc every so often and i can compile hello world ok on:

1. an amiga
2. a UAE amiga on my PC
3. on my PC

but i'd love to be able to cross compile. and i'm halfway through being able to do that except for the aforementioned rocket science. bloody hell

edit: i have no trouble typing raw c / c++ into microsoft's visual studio and hitting the "build" button by the way. cept i cant use that to make amiga stuff!


 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: gcc wont compile with // comments?
« Reply #1 on: November 18, 2003, 01:33:10 AM »
well i went back and started over, i still get the same issues using gcc but now when i use g++ it just says

make: *** [obj/doomdefs.o] Error 1

after, apparently, succesfully compiling doomdef.c ... bah!

makefile:

edit 3: makefile chopped

edit: oh bloody hell! i asserted that i do indeed have gcc270 by unLHAing the arcs into my gnu dir and suddenly it cant find any of my amiga includes! i forgot how to configure that

edit 2: ok so i found a 295 build somewhere and nearly set  it up ok except it says there's no include path or something for it to find the includes... i just copied them all into gnu/include and it STILL cant find them argh! now i cant even compile my "test" code which is a standard amigaos prog that simply opens a wb window with text in that you can close... .... nooooo!  it used to work as it was the first thing i got going the first time i got gnu going.... noooo!

someone come to my house, slap me round the face and proceed to say. YOU'RE SUPPOSED TO CONFIGURE GCC LIKE THIS!
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: gcc wont compile with // comments?
« Reply #2 on: November 18, 2003, 11:04:32 AM »
ditto, dammit

 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: gcc wont compile with // comments?
« Reply #3 on: November 18, 2003, 12:53:20 PM »
well i found a backup of a working gcc setup. good job that. now i can compile my test window program again. it's a good test one as it invokes a few amiga libs so for it to woork my headers etc have to be set up the same.

i've experimented with simply inserting the gcc bin from 295 and 330 into my setup but it simply wont have it. and anyway, how come every gcc distro has a totally different directory structure with bins and libs in a million subfolders. yeah i know all about targetting and processors but FFS cant it jsut all go in /bin /lib and /include and have that as that!?
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: gcc wont compile with // comments?
« Reply #4 on: November 18, 2003, 02:27:46 PM »
cpp has a -lang-C++ switch which alledgedly allows // comments to be used by gcc but i havent managed to get gcc to pass the argument on to cpp, either that or it's ignoring it.

as for geekgadgets the /current folder has about 1 million tgz files in it and the \alpha\gcc dir has the aforementioned 295 and 330 in, both of which i cant get to work, at all. i probably need some other files to go with them or something.

like was said before. isnt there just a ####ing installer or would that be too easy?

edit: the gg site has an install doc page which lists the packages to get. so i've set my ftp prog off getting, well, everything. i'm in a mind to zip up my "working" 270 for other people to use.
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: gcc wont compile with // comments?
« Reply #5 on: November 18, 2003, 03:43:54 PM »
bugger, i downloaded an entire snapshot (990529/bin) from geekgadgets and it doesnt even contain a gcc archive... eh!?!? oh and all the arcs have different version numbers.

someone please help
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: gcc wont compile with // comments?
« Reply #6 on: November 20, 2003, 01:00:51 AM »
it works! someone on a newsgroup pointed me at the mammoth 80mb golded install download, which i duly dowloaded and installed, then cropped out the gcc 295 and 330 distros. all 99% preconfigured by the installer. hurrah!

unfortunatley i still have the exact same problem i had before: __asm does not work. some minor google scouring seems to suggest that gcc has traditionally bad asm support. but i obviously need asm to be able to link into various os libraries, for example.

so: anyone know how to __asm a function in gcc?
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: gcc wont compile with // comments?
« Reply #8 on: November 20, 2003, 02:52:57 AM »
i'm getting closer. by examining other peoples source i can now properly declare/prototype functions that would, otherwise, use __asm. here it is

#ifdef __SASC
#   define SAVEDS       __saveds
#   define ASM          __asm
#   define REG(x,y)     register __##x y
#elif defined(__GNUC__)
#   define SAVEDS       __saveds
#   define ASM
#   define REG(x,y)     y __asm(#x)
#elif defined(_DCC)
#   define SAVEDS       __geta4
#   define ASM
#   define REG(x,y)     __##x y
#elif defined(__STORM__)
#   define SAVEDS       __saveds
#   define ASM
#   define REG(x,y)     register __##x y
#elif defined(__VBCC__)
#   define SAVEDS       __saveds
#   define ASM
#   define REG(x,y)     __reg(#x) y
#else
#   error   add #defines for your compiler...
#endif

if anyone understands, that is, i found it in the blitzquake source: amigacompiler.h, heh.

then you can proto your function thus:

static void ASM thefunction( REG(a1,UBYTE *), REG(a2,UBYTE *), REG(a6,struct Library *));



NEXT PROBLEM:

compiling assembler ("whatever.s") files in gcc (as) ... i get an error for EVERY line of assembler along the lines of:

 unknown operator -- statement: ASM STATEMENT

or

parse error -- ASM STATEMENT

and

rest of line ignored, first ignored character is '@'



anyone?

 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: gcc wont compile with // comments?
« Reply #9 on: November 20, 2003, 03:49:10 PM »
i knew somebody would say that.. gcc auto detects assembly files (extension *.s is the standard) and passes them over to it's own assembly compiler, "as". i've got "phxass" too but i cant get make to let me use it for some reason, bizzare.

NEXT!
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
compiling assembly.s files in gcc was: gcc wont compile with // comments?
« Reply #10 on: November 20, 2003, 04:58:37 PM »
yer, well it starts off with something like "Assembler Output:" before giving me all the errors. i'm half way now to figuring phxass out now. though i suspect i need to use it for the intermidiate assempler->object for the gcc c compiled files also. though i wouldnt know how to do that either!
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: compiling assembly.s files in gcc was: gcc wont compile with // comments?
« Reply #11 on: November 21, 2003, 10:03:01 PM »
well, i havent got as far as the hunk stage, as i'm still stuck at the assembly.s file stage. i first thought it might have been a pedantic syntax error. e.g. not having the commands at the first tab, or having lower case instructions instead of uppercase. but that's about my limit of assembly knowledge! really.

my // comments are accepted by gcc330, which is what i'm using now
 

Offline cycloidTopic starter

  • Full Member
  • ***
  • Join Date: Jun 2002
  • Posts: 155
    • Show all replies
Re: compiling assembly.s files in gcc was: gcc wont compile with // comments?
« Reply #12 on: November 22, 2003, 03:08:15 AM »
again, i'm lurching along one inch at a time. if i manually instruct phxass to compile a filename.s file then it's happy to do so. howevery i get a bunch of errors relating to FUNCDEF. from what i can gather i need a funcdef macro, well there's one in libraries.i thus

   FUNCDEF       MACRO
   _LVO\1       EQU   FUNC_CNT
   FUNC_CNT    SET   FUNC_CNT-6
   FUNC_CNT    EQU   LIB_USERDEF   
          ENDM

which doesnt do the job, phxass simply says "unkown directive" for each line.

my other problem is somehow getting phxass and gcc's make to coexist so i dont have to manually do each .s file. and i still don't know if there will be issues with phxass's outputs and gccs.