It is speculated that Al-Razi's Akhbār mulūk al-Andalus, known in Spanish as Crónica Del Moro Rasis, first associated Hercules with the room that contained the prophecy Moors would invade Spain, as he mentions Hercules many times, but the extent fragments don't show his version of Roderic.
And Toledo was always the house of the kings and all chose it as the
best, and especially for their dwelling place, because it was in all
things made according to their will. And it was one of the four good
cities that Hercules founded in Spain. And afterwards the Caesars
always had it as their home.
-Akhbār mulūk al-Andalus/Crónica Del Moro Rasis, Debora Warner translation
The first extent source to definitively ascribe the tower and prophecy in Toledo to Hercules was the Crónica 1344, compiled from older legends, perhaps including the lost text of Al-Razi
Chapter LXXVII (77) How they who guarded the house that Hercules made
in Toledo, came to King Rodrigo and told him to put his lock on that
house After everything had happened in that way, they who guarded the
house of Toledo came to the king and told him:
----(this is what Spanish sometimes uses as quote marks) Sir, it is good for you to put your lock on that house that we must guard. And
the king said to them:
___What house is that? Or why should he put his lock there: And they said:
----Sir, we will tell it to you with good will, what we know truly. Sir, you know that when Hercules came to Spain, he caused to be built
there a house so subtle, by such great mastery that we do not know how
to tell how it was made, or by whose wisdom. And this house of which
we speak is in Toledo. It is all round, and if you were to see it,
sir, it would it would seem to you like nothing so much as a wooden
jug that is standing straight on its cork. And we can well tell you
that many men have tried to throw small stones to the top of this
house and we never saw a man that could throw one from the other side.
And we have taken counsel, in truth, that you could not find in all
the world any that by his intelligence could tell you how this house
is wrought within much less what we can see from outside. And we will
tell you further that in the whole house there is not a stone of a
similar color that could have been placed by a man in a year. And we
estimate well that almost all these stones are marble. And they are so
bright that it is a wonder and they are of so many colors. And do not
be concerned that there are even two or three stones there of the same
color. And they are so cunningly joined together that it would seem to
your grace that –if it were not for the colors—that the whole house is
one stone. And it seems, and in such a manner it is cunningly made,
that the stories that appear in it, would seem to you a mockery until
you saw it. You might believe that they are painted, but the stones
are so placed that they would seem to you that such well-represented
cavalcades could not be found in the world, but that their history is
not there represented. And this house is on four metal lions so large
that it is a wonder. And what should we say to you, sir, of this
house? We estimate that in the world, there was never a man who could
tell you even all the wonders that are seen only from the outside. And
well, Hercules made this house and put in it a door that is not very
large, and made a lock to be put on it that is so subtly made, as you
will be able to
see. And, before doing this, he went inside and placed there we know
not what, nor can we estimate that today there may be in the world a
man who may know it, no could have known it if he did not. And, after
he had done this, he wrote on the door in well graven letters of blue
and gold that said thus: “I defend against any who may dare—for
strength or wisdom that he may have—to open this door. And I command
and plead with all the kings that may come after me, that they put on
this door bolts and locks, and that you cause it to be guarded as well
as I would do.” Then he gave the key of that lock to twelve of the
best men for them to guard it. And he made them to swear on the Faith
that, in all the time that they could, that the door might never be
opened. And he made the Council of Toledo to swear by oath that, when
one of those who were to guard the house should die, that they would
put another in his place right away: “And—because Hercules was very
desirous and lucky and was very understanding of the things that were
to come, and never in Spain was there a king that wished to break his
command, all before did according to his command—we, who have the
guarding of that house, come to you that you may put your lock
thereon.” King Rodrigo, who was a man of great heart, told them that
he would not do it, but wanted to know all manner of things in the
world that lay therein. And they told him not to do this, any more
than the others who had come before him had done. And King Rodrigo
said to them:
--Leave be, I will arrange to see as quickly as possible how that house is, and then I will do as seems best to me. And as he would give
them no other assurance, they left.
Then interrupts the tale of Count Julian's daughter, before returning to the Tower of Hercules
CHAPTER LXXX (80) p. 99 How King Rodrigo went to see the house of
Toledo And as many as there were there were astonished that it should
occur to the king to discount the facts of the house that they of
Toledo told him; and he went to look and saw it. And he saw that there
were many strange things in it that the guards had not told him. And
immediately he sent for his intimates and those who were of his
council, and told them that all else in the world regardless, he
wanted to see what lay in that house. And all in common said to him
that he should not do it, that he ought not to do what no other had
done. And he said:
--In this house there is only what may be seen, or enchantments. And if so, we will take it, if it is enchantment, certain it is that they
cannot harm me. Then I have no reason to leave off. And they told him:
--Sir, do that which pleases thee, but this is not by our counsel or our will. And he without delay went to the doors of the house and
caused them to be broken open. But this was from his great desire, and
there were so many keys and locks that it was a wonder. And, after it
was open, he and some of his followers entered. And they found a
square palace, as much in one part as the other, so marvelous that no
man could say. One part of the palace was as white as the snow of
today, that could not be more white; and the other part of the palace,
across from that, was as black as the blackest thing there is in the
world, that there could not be any blacker; and the other part of the
house was as green as the lime or like a thing that would by nature be
very green; and the other part was as russet as blood. And the palace
was as clear as a crystal, nor could a man see anything as clear in
the world. And it seemed as if each of the parts of the palace did not
have more than door pathways; and of those who entered there that saw
it, there was none there that would know to say how stone was joined
with which stone, nor how it could be separated. And all held that the
palace was the most marvelous that they had ever seen, because they
saw in it things that
they could not tell for its very wondrousness, more than they had ever
seen. In the palace there was neither board nor any nail, that as the
foundation was all flat, so it was above, and there were windows where
the light entered whereby they could see everything that was there.
And after they examined how the palace was made and they had
considered, they never could see nor evaluate, but that the best thing
that they saw would be a stele, not very thick; and it was all round
and was as tall as a man; and there was a door there, very subtly made
and even small, and on top of it, thick letters that said after this
manner: When Hercules made this house, it was about four thousand and
six years of the era of Adam.” And, after they opened the door, they
found within open letters that said, “This house is one of the marvels
of Hercules.” And, after they read these words, they saw a niche in
the stele, in which was a silver box. And this was a very well made
box, ornamented with gold and silver and with precious stones, and it
had a lock made of pearl so noble that it is wondrous; and there were
on it Greek letters that said: “Oh king, if in your time this box
should be opened, it cannot be but that you will see marvels before
you die, and this Hercules, lord of Greece, know a thing before it was
to come.” And King Rodrigo then said:
--In this box is what we sought, and what Hercules so defended. Then he broke the lock with his hand, for there was none other there who
would dare open it. And after the box was opened and the lock broken,
they found nothing in the box except a white cloth affixed between two
boards; they loosed it and opened the cloth and found Arabs drawn on
it, with their toques on their heads and lances with standards in
their hands, and their swords at their necks and their horses behind
them, with their saddles having saddlebows. And above the figures
were letters that said: “When this cloth shall be stretched open and
these figures appear, men in such armor will take and conquer Spain
and will be lords over her.” When King Rodrigo saw this, it sorrowed
him and all those of his council. They said to him:
--Sir, now see what has come upon us, because you would not believe and valued so little those who came before you!”
And he told them in great sorrow: “May it please God that not all of
it be true that the ancients foretold. And why are you so concerned
that this might not be a judgement on me? And from today on, we have
nothing to fear, because it is already done, and now it cannot be
otherwise. And what it speaks of, of that which is to come, does not
wound my heart, as a thing that men should tell.” The palace was
examined that day by many good men, and they all said that they had
never seen nor heard speak of such fine work. And King Rodrigo
commanded that none should speak of what was found there. And
afterwards he ordered the door of the palace firmly closed; and from
there it went out that he had a very rich and noble palace in Toledo.
-Crónica 1344, Debora Warner translation
It is Crónica 1344 that seems to serve the main backbone for Crónica Del Rey Don Rodrigo's account of the same story a century later.