It seems that 'gas' is getting confused by C-style /* */ comments.
The problem is that 'gcc' should have called the C preprocessor, 'cpp',
before calling 'gas'. Why didn't it?
Well, 'gcc' uses the case of the file extension to decide what to do:
A lower case '.s' extension causes 'gcc' to call 'gas' directly.
An upper case '.S' extension tells 'gcc' that it needs to run the source
through 'cpp' first, and then call 'gas'.
I assume you had LFN=y and unzipped the source using a
case-sensitive utility like WinZip or unzip32. Unfortunately,
a quick look at the contents of djlsr201.zip shows that all
assembly files, longjmp.s included, have the (incorrect) lower
case '.s' extension. The result: 'cpp' is not called, the C-style
comments are not stripped, and 'gas' chokes.
I don't know of any flag to force 'gcc' to call the preprocessor even for
'.s' files, so the only permanent solution is to rename them all to have
the proper '.S' extension.
There are several workarounds:
(1) The quickest method is to set the environment variable LFN=n
before you recompile, or make the change in djgpp.env if you don't mind
making it permanent. Then all file names are treated as upper case.
(2) If you'd rather keep long file names turned on, try unzipping the
source with PKUNZIP or UNZIP (real mode), which force all file names
to upper case. (I haven't tried this).
(3) Rename all '.s' file extensions in the source tree to '.S'. Something like the following 'sed' command should produce a batch file which
does the trick. (I hope this mess of backslashes makes it through
the bug system). Run it from the 'src' directory of the djgpp hierachy.
dir /b /s *.s | sed -e 's/\(.\+\\\)\([^\\]\+\)\.\([sS]\)/ren \1\2.\3 \2.s/' > fixit.bat
Run fixit.bat and, voila! The problem is solved for good!