Skip to content

Commit

Permalink
Old Patch, Manually added, does not build cleanly. Removed for now.
Browse files Browse the repository at this point in the history
Revert "Patch 7467: Adds support for c++ new and delete operators"

This reverts commit 943f6d9.
  • Loading branch information
stevenj committed Jul 17, 2019
1 parent 943f6d9 commit 0176994
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 89 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,3 @@ Some attiny chips use the RSIG bit instead of SIGRD to read from the signature
imprint area. From a quick grep, this concerns: tn1634, tn4313, tn441, tn828,
tn841, tn24, tn44, tn84, tn25, tn45, tn85. This changes was tested on a tn841
only, where no other changes are needed than using another name for this bit.

### Merged Upstream Patch 7467

Adds support for c++ new and delete operators
5 changes: 0 additions & 5 deletions devtools/Architecture.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright (c) 2004, Theodore A. Roth
# Copyright (c) 2005, 2008, 2009 Anatoly Sokolov
# Copyright (c) 2011 Bradley Jarvis
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -50,12 +49,9 @@ AM_CPPFLAGS = -I$(top_srcdir)/common -I$(top_srcdir)/include -I$(top_builddir)/i

AVRLIB_CFLAGS = @CDEBUG@ -Wall -W -Wstrict-prototypes -mmcu=$(AVR_TARGET) $(AVR_TARGET_DEFS) $(AVR_TARGET_CFLAGS)

AVRLIB_CXXFLAGS = @CDEBUG@ -Wall -W -mmcu=$(AVR_TARGET) $(AVR_TARGET_DEFS) $(AVR_TARGET_CFLAGS)

AVRLIB_ASFLAGS = -x assembler-with-cpp @ASDEBUG@ -mmcu=$(AVR_TARGET) $(AVR_TARGET_DEFS) $(AVR_TARGET_ASFLAGS)

AM_CFLAGS = $(AVRLIB_CFLAGS)
AM_CXXFLAGS = $(AVRLIB_CXXFLAGS)
AM_CCASFLAGS = $(AM_CPPFLAGS) $(AVRLIB_ASFLAGS)

__install_dir = $(prefix)/avr/lib/$(AVR_INSTALL_DIR)
Expand All @@ -81,7 +77,6 @@ include $(top_srcdir)/libc/time/Rules.am

nodist_libc_a_SOURCES = \
$(stdlib_a_c_sources) \
$(stdlib_a_cxx_sources) \
$(stdlib_a_asm_sources) \
$(pmstring_a_c_sources) \
$(pmstring_a_asm_sources) \
Expand Down
4 changes: 0 additions & 4 deletions devtools/Device.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright (c) 2004, Theodore A. Roth
# Copyright (c) 2005, 2008 Anatoly Sokolov
# Copyright (c) 2011, Bradley Jarvis
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -62,12 +61,9 @@ AM_CPPFLAGS = -I$(top_srcdir)/common -I$(top_srcdir)/include -I$(top_builddir)/i

AVRLIB_CFLAGS = @CDEBUG@ -Wall -W -Wstrict-prototypes -mmcu=$(AVR_TARGET) $(AVR_TARGET_DEFS) $(AVR_TARGET_CFLAGS)

AVRLIB_CXXFLAGS = @CDEBUG@ -Wall -W -mmcu=$(AVR_TARGET) $(AVR_TARGET_DEFS) $(AVR_TARGET_CFLAGS)

AVRLIB_ASFLAGS = -x assembler-with-cpp @ASDEBUG@ -mmcu=$(AVR_TARGET) $(AVR_TARGET_DEFS) -DIOSYMFILE=\"iosym/$(AVR_TARGET).S\" $(AVR_TARGET_ASFLAGS)

AM_CFLAGS = $(AVRLIB_CFLAGS)
AM_CXXFLAGS = $(AVRLIB_CXXFLAGS)
AM_CCASFLAGS = $(AM_CPPFLAGS) $(AVRLIB_ASFLAGS)


Expand Down
24 changes: 11 additions & 13 deletions doc/api/faq.dox
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ compiled. Among them are:
- Obviously, none of the C++ related standard functions, classes,
and template classes are available.

- The operators \c new and \c delete are not implemented, attempting
to use them will cause the linker to complain about undefined
external references. (This could perhaps be fixed.)

- Some of the supplied include files are not C++ safe, i. e. they need
to be wrapped into \code extern "C" { . . . } \endcode
(This could certainly be fixed, too.)
Expand All @@ -262,14 +266,8 @@ compiled. Among them are:
this, the linker will complain about an undefined external
reference to \c __gxx_personality_sj0.

What is currently supported:

- Constructors and destructors including global ones.

- The operators \c new and \c delete are also implemented, they do not
however support exceptions. They are located in libc in stdlib
and are wrappers for malloc and free.

Constructors and destructors \e are supported though, including global
ones.

When programming C++ in space- and runtime-sensitive environments like
microcontrollers, extra care should be taken to avoid unwanted side
Expand Down Expand Up @@ -937,30 +935,30 @@ the different optimization levels, and added about 2.5 KB to the code.
<tr>
<td>-O3</td>
<td>6898</td>
<td>903 �s</td>
<td>903 �s</td>
<td>19.7 ms</td>
</tr>
<tr>
<td>-O2</td>
<td>6666</td>
<td>972 �s</td>
<td>972 �s</td>
<td>20.1 ms</td>
</tr>
<tr>
<td>-Os</td>
<td>6618</td>
<td>955 �s</td>
<td>955 �s</td>
<td>20.1 ms</td>
</tr>
<tr>
<td>-Os -mcall-prologues</td>
<td>6474</td>
<td>972 �s</td>
<td>972 �s</td>
<td>20.1 ms</td>
</tr>
</table>

(The difference between 955 �s and 972 �s was just a single
(The difference between 955 �s and 972 �s was just a single
timer-tick, so take this with a grain of salt.)

So generally, it seems <tt>-Os -mcall-prologues</tt> is the most
Expand Down
3 changes: 0 additions & 3 deletions libc/stdlib/Files.am
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ stdlib_a_c_sources = \
dtoa_conv.h \
stdlib_private.h

stdlib_a_cxx_sources = \
new.cc

stdlib_a_asm_sources = \
abort.S \
atof.S \
Expand Down
1 change: 0 additions & 1 deletion libc/stdlib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ include $(top_srcdir)/libc/stdlib/Files.am

EXTRA_DIST = \
$(stdlib_a_c_sources) \
$(stdlib_a_cxx_sources) \
$(stdlib_a_asm_sources) \
$(stdlib_a_extra_dist)
59 changes: 0 additions & 59 deletions libc/stdlib/new.cc

This file was deleted.

0 comments on commit 0176994

Please sign in to comment.