Skip to content

Conversation

@synthead
Copy link

This PR fixes an issue when compiling with gcc 10. extern statements are required when declaring variables in header files, so this adds these.

Without this PR, this is what is seen when compiling with gcc 10:

linking shared-object rpi_gpio/rpi_gpio.so
/usr/bin/ld: rb_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:37: multiple definition of `gpio_mode'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:37: first defined here
/usr/bin/ld: rb_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:43: multiple definition of `rpiinfo'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:43: first defined here
/usr/bin/ld: rb_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:41: multiple definition of `pin_to_gpio'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:41: first defined here
/usr/bin/ld: rb_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:45: multiple definition of `module_setup'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:45: first defined here
/usr/bin/ld: rb_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:44: multiple definition of `setup_error'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:44: first defined here
/usr/bin/ld: rb_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:42: multiple definition of `gpio_direction'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:42: first defined here
/usr/bin/ld: rb_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:40: multiple definition of `pin_to_gpio_rev3'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:40: first defined here
/usr/bin/ld: rb_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:39: multiple definition of `pin_to_gpio_rev2'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:39: first defined here
/usr/bin/ld: rb_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:38: multiple definition of `pin_to_gpio_rev1'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:38: first defined here
/usr/bin/ld: rb_pwm.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:42: multiple definition of `gpio_direction'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:42: first defined here
/usr/bin/ld: rb_pwm.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:45: multiple definition of `module_setup'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:45: first defined here
/usr/bin/ld: rb_pwm.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:44: multiple definition of `setup_error'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:44: first defined here
/usr/bin/ld: rb_pwm.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:43: multiple definition of `rpiinfo'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:43: first defined here
/usr/bin/ld: rb_pwm.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:41: multiple definition of `pin_to_gpio'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:41: first defined here
/usr/bin/ld: rb_pwm.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:40: multiple definition of `pin_to_gpio_rev3'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:40: first defined here
/usr/bin/ld: rb_pwm.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:39: multiple definition of `pin_to_gpio_rev2'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:39: first defined here
/usr/bin/ld: rb_pwm.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:38: multiple definition of `pin_to_gpio_rev1'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:38: first defined here
/usr/bin/ld: rb_pwm.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:37: multiple definition of `gpio_mode'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:37: first defined here
/usr/bin/ld: rpi_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:45: multiple definition of `module_setup'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:45: first defined here
/usr/bin/ld: rpi_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:44: multiple definition of `setup_error'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:44: first defined here
/usr/bin/ld: rpi_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:43: multiple definition of `rpiinfo'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:43: first defined here
/usr/bin/ld: rpi_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:42: multiple definition of `gpio_direction'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:42: first defined here
/usr/bin/ld: rpi_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:41: multiple definition of `pin_to_gpio'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:41: first defined here
/usr/bin/ld: rpi_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:40: multiple definition of `pin_to_gpio_rev3'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:40: first defined here
/usr/bin/ld: rpi_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:39: multiple definition of `pin_to_gpio_rev2'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:39: first defined here
/usr/bin/ld: rpi_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:38: multiple definition of `pin_to_gpio_rev1'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:38: first defined here
/usr/bin/ld: rpi_gpio.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:37: multiple definition of `gpio_mode'; common.o:/home/deploy/on-air/.misc/rpi_gpio/tmp/armv7l-linux-eabihf/rpi_gpio/3.0.2/../../../../ext/rpi_gpio/common.h:37: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:262: rpi_gpio.so] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant