wybe icon indicating copy to clipboard operation
wybe copied to clipboard

Multiple specializations are sometimes missing from .o files

Open jimbxb opened this issue 2 years ago • 2 comments

Occasionally I encounter an error when compiling a program.

Replicating the error is a bit fiddly, but it happens most often after a fresh make and then compiling with ./wybemk -f -L wybelibs foo.

Compiling with another install via wybemk -f -L wybelibs foo does work, and then trying with the original command again will cause the compilation to succeed.

Example file: (Note this can be anything) foo.wybe

!println(3 >> 1)

Error:

/usr/bin/ld: /home/james/docs/wybe/wybelibs/command_line.o: in function `command_line.<0>':
command_line.wybe:(.text.command_line.<0>+0x39): undefined reference to `wybe.array.[|]<0>[785a827a1b]'
collect2: error: ld returned 1 exit status

Error detected during building outputs
/usr/bin/ld: /home/james/docs/wybe/wybelibs/command_line.o: in function `command_line.<0>':
command_line.wybe:(.text.command_line.<0>+0x39): undefined reference to `wybe.array.[|]<0>[785a827a1b]'
collect2: error: ld returned 1 exit status

Using nm to dump the defined names in the compiled wybelibs/wybe/array.o file, the multiple specialisation of wybe.array.[|]<0> is missing, and that is why the linker fails.

jimbxb avatar Mar 18 '22 08:03 jimbxb

Some more odd behaviour:

Removing the -f flag from compilation after a fresh install works.

Before compilation, nm does not find the multi-spec. After, it does.

I am confused.

jimbxb avatar Mar 18 '22 08:03 jimbxb

hmm, interesting, I'll try to have a look when I got time.

CaviarChen avatar Apr 02 '22 16:04 CaviarChen