RuntimeTools / appmetrics

Node Application Metrics provides a foundational infrastructure for collecting resource and performance monitoring data for Node.js-based applications.
https://developer.ibm.com/open/node-application-metrics/
Apache License 2.0
970 stars 125 forks source link

Build fails with GCC version 10.1.0 #641

Open acheronfail opened 4 years ago

acheronfail commented 4 years ago

I've noticed that building appmetrics with the latest version of gcc fails. I've tried this on multiple node versions (10, 12 & 13).

The last good working version of gcc is 9.3.0. Building it with 10.1.0 fails with the following output:

... other logs and warnings ...

  SOLINK(target) Release/obj.target/omr-agentcore/libhcmqtt.so
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Log.o:(.bss+0x20): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Messages.o:(.bss+0x0): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTAsync.o:(.bss+0x68): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTPacket.o:(.bss+0x0): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTPacketOut.o:(.bss+0x0): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTPersistence.o:(.bss+0x0): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTPersistenceDefault.o:(.bss+0x0): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTProtocolClient.o:(.bss+0x0): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/MQTTProtocolOut.o:(.bss+0x0): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/SocketBuffer.o:(.bss+0x0): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Socket.o:(.bss+0x1a8): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/StackTrace.o:(.bss+0x0): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Thread.o:(.bss+0x0): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
/usr/bin/ld: ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/utf-8.o:(.bss+0x0): multiple definition of `Log_levels'; ./Release/obj.target/hcmqtt/omr-agentcore/org.eclipse.paho.mqtt.c/src/Heap.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [omr-agentcore/hcmqtt.target.mk:174: Release/obj.target/omr-agentcore/libhcmqtt.so] Error 1
make: Leaving directory '/home/cosmotherly/work/incredible-monorepo/node_modules/appmetrics/build'

Some information about my system:

Arch Linux 5.4.41-1-lts x86_64 GNU/Linux

And I've confirmed the issue fails to build with gcc 10.1.0 on various node versions:

10.19.0
10.20.1
12.16.3
13.6.0

Downgrading to gcc 9.3.0 resolves the issues for me.

mitermayer commented 3 years ago

same problem here! do we have plans on fixing this ?

mitermayer commented 3 years ago

@acheronfail I actually realized that I have the same issue as you and the same system since we both work at the same place and are falling with the same project. How did you manage to solve this issue? I tried to find you on slack but could not find you based on your GitHub username alone

acheronfail commented 3 years ago

Depending on what I'm doing I do one of two things:

CaelumF commented 3 years ago

For people who would rather not downgrade several major gcc versions just for this 1 package, the following works for me and I hope will help you too:

1) install gcc 9.30 separately using a package manager or whichever method you like

2) When installing something that depends on appmetrics, use:

env CC=/path/to/gcc-9 npm install