It looks like the compiler is emitting incorrect assembler directives.
I have not got to the bottom of this yet and if there is a neat workaround.
However a quick workaround is to delete them.
With "XCC_FLAGS = -g -O2 -report -fxscope -save-temps" in the Makefile run:
- xmake clean
xmake
# Error: Undefined reference to 'i2c_master.select.y.enable.cases'
grep -v "i2c_master.select.y.enable.cases" < .build/main.s | xas -march=xs2a -o ".build/src/main.xc.o" "-g"
grep -v "i2c_master.select.y.enable.cases" < .build/i2c_master.s | xas -march=xs2a -o ".build/_l_i2c/src/i2c_master.xc.o" "-g"
xmake